I am new to the notion of algebraic scheme, so I am not sure if the questions I am about to make are actually trivialities.
The thing is that in James Milne's notes in Algebraic Groups, there is a point in which he says that given a field $k$ and an algebraic $k$-scheme $X$, we can identify $X(k)=\mathrm{Hom}(\mathrm{Spm}(k),X)$ with the set of points $x\in X$ such that the residue field at $x$ is $k$. My question is: why?
I know that given a point $x\in X$, there exists an affine neighbourhood $U=\mathrm{Spm}(A)$ that contains $x$ and $\mathrm{Hom}(\mathrm{Spm}(k),\mathrm{Spm}(A))$ is isomorphic to the set of homomorphisms between $k$-algebras, $\mathrm{Hom}(A,k)$, but I do not know how to continue with the proof.
On the other hand, I have noticed that in almost any other books the authors prefer to use the spectrum of a ring rather than the maximal spectrum of a $k$-algebra, which is the basis for James Milne's book. Why is it? Is it because in the end using Hilbert's Nullstellensatz the prime ideals of $A$ correspond to irreducible sets of $\mathrm{spm}(A)$?
Also, let $(G,m)$ denote an algebraic group over a field $k$. Could someone give me examples that show that when $k$ is not algebraically closed, $(G(k),m(k))$ is not (in general) a group?