I was reading proposition 2.3 and I could not prove the following
Given a homomorphism of rings $\phi \colon A \to B$, we define a map $f \colon \operatorname{Spec} B \to \operatorname{Spec} A$ by $f(p)=\phi^{-1}(p)$. The books says that the following is immediate
$f^{-1}(V(a))=V(\phi(a))$ for any ideal $a$ in $A$.
But I can't see it yet. This is what I did
$f^{-1}(V(a))=\{p \in \operatorname{Spec} B \mid f(p)=\phi^{-1}(p) \in V(a) \text{ i.e } \phi^{-1}(p) \supseteq a \}$
$V(\phi(a))=\{ p \in \operatorname{Spec} B \mid p \supseteq \phi(a) \}$
It is immediate that if $p \supseteq \phi(a)$ then $\phi^{-1}(p) \supseteq \phi^{-1}(\phi(a)) \supseteq a $. It follows that $V(\phi(a)) \subseteq f^{-1}(V(a))$.
On the other hand if $\phi^{-1}(p) \supseteq a$ then $\phi(\phi^{-1}(p)) \supseteq \phi(a)$.
This holds true if whenever $p \in \operatorname{Spec} B$ then $p \subseteq \phi(A)$. And I'm not sure if this is true.
This is a community-wiki answer recording the discussion from the comments so that this question may be marked as answered (once this post is upvoted or accepted).