free module implies surjective map of affine schemes If $A\to B$ is such that $B$ is a free $A$-module, is it true that $Spec(B)\to Spec(A)$ is surjective? I suspect it is true that there is a projection $B\to A$ so that the composition $A\to B\to A$ is the identity map (of rings), but I'm not sure.
 A: Yes, this is true, assuming that it's not free of rank $0$. Choose a point $y\in\text{Spec}(A)$. Then, the set-theoretic fiber over $y$ can be identified with the scheme theoretic fiber $(\text{Spec}(B))_y$, which fits into the following fibered diagram 
$$\begin{matrix}(\text{Spec}(B))_y & \to & \text{Spec}(B)\\ \downarrow & & \downarrow\\ k(y) & \to & \text{Spec}(A)\end{matrix}$$
In particular, the fiber is just $\text{Spec}(B\otimes_A k(y))$. But, since $B$ is free as an $A$-module, then $B\otimes_A k(y)$ is just a free $k(y)$-space of dimension $\text{rank}_A(B)$. In particular, if $\text{rank}_B(A)>0$, then $\dim_{k(y))} B\otimes_A k(y)>0$, and so can't be the zero ring. In particular, the fiber $\text{Spec}(B\otimes_A k(y))$ is non-empty.
More generally, if $A\to B$ is flat, then $\text{Spec}(B)\to\text{Spec}(A)$ is surjective if and only if $A\to B$ is faithfully flat. Certainly if $B$ is a free $A$-module, then $A\to B$ is faithfully flat.
A: Here's a proof that is possibly what Vakil had in mind, at the very least it only uses ideas already developed at this point in the notes.
Let us write $\varphi$ for the map from $A$ to $B$, and let $\mathfrak{p} \in \operatorname{Spec}(A)$. We show that $\mathfrak{p}$ is in the image of the map induced by $\varphi$ by showing that there is some prime in $B$ lying over $\mathfrak {p}$ (i.e. a prime $\mathfrak{q}$ with $\varphi^{-1}(\mathfrak{q}) = \mathfrak{p})$. 
Observe that the primes $\mathfrak{q}$ of $B$ lying over $\mathfrak{p}$ with respect to $\varphi:A\rightarrow B$ correspond exactly to the primes lying over $0$ in $B/(\varphi(\mathfrak{p})B)$ with respect to $\overline{\varphi}:A/\mathfrak{p}\rightarrow B/(\varphi(\mathfrak{p})B)$. Thus, after noting noting that if $B$ is a free $A-$module, $B/(\varphi(\mathfrak{p})B)$ is a free $A/\mathfrak{p}-$module of the same rank, we may reduce to the case $\mathfrak{p} = 0$ and $A$ is an integral domain. 
In this case, the primes in $B$ lying over $(0)$ correspond exactly to the primes of $B_{(0)}$, the localisation of $B$ by $A\setminus{0}$. But then if $B$ is a free $A-$module, $B_{(0)}$ is a free $A_{(0)}$ module of the same rank. In particular, it is non-zero, so contains some prime. Thus $B$ contains a prime lying over $(0)$ and we are done.
Remark: We could have equally well localised first and then taken the quotient*. However, after localising we don't then really need to take a quotient, since we're just looking for primes which contain $\varphi(\mathfrak{p})B$. We know one exists so long as $\varphi(\mathfrak{p})B \not= B$, but this cannot happen by Nakayama's lemma.** This is probably not any quicker, but we see that it actually proves that for any morphism of affine schemes $\pi:\operatorname{Spec}(B)\rightarrow\operatorname{Spec}(A)$ with $A$ a local ring, the unique closed point of $\operatorname{Spec}(A)$ is contained in the image of $\pi$, which seems like a handy fact to know.
*Localisation restricts to things that lie over primes contained in $\mathfrak{p}$ and quotienting restricts to things that lie over primes containing $\mathfrak{p}$, so doing both gives exactly the primes that lie over $\mathfrak{p}$.
**The version of Nakayama's lemma used here is that if $A$ is any ring, and $M$ an $A-$module, then for an ideal $I$ contained in every maximal ideal of $A$, $IM=M$ iff $M = 0$. This is a slightly stronger version than what Vakil proves in an earlier chapter, where he assumes $M$ is finitely generated.
