Claim: Let $\varphi: A\rightarrow B$ be a ring homomorphism. Then there exists a continuous map $$f:SpecB\rightarrow SpecA: P\mapsto \varphi^{-1}(P)$$ My thoughts: It suffices to check the preimage of closed subsets are closed. If we take any closed subset $V(I)=\{p\in SpecA| p\supset I\}\subset SpecA$. We need to check if the preimage of $V(I)$ is of the form $V(J)$ for some ideal $J\in SpecB$. It looks like the preimage of $p\in V(I)$ is $\varphi(p)\cdot B$ (ideal generated by $\varphi(p)$). Certainly, it is an ideal in $B$. But it still remains to check:
- Is $\varphi(p)\cdot B$ a prime ideal?
- Is it true that $\varphi^{-1}(\varphi(p)\cdot B)=p$?
Note that $\varphi$ is not necessarily surjective, we know $\varphi(p)$ is a prime ideal in $im(\varphi)$ but I do not know how to show (1)
Secondly, I do not not know how to show (2). It is certainly true that $\varphi^{-1}(\varphi(p)\cdot B)\supset p$. But in order to show another inclusion we still need to show $im(\varphi)\cap (\varphi(p)\cdot B)=\varphi(p)$.
Both these two statements does not seem very likely to be true and I have no idea.
Neither of these are true in general! Take something like $\varphi:\mathbb Z\to\mathbb Z[x]/(x^2)$, then
$1.$ the element $2$ generates a prime ideal $p=(2)$ in $\mathbb Z$ but $(2)$ is not a prime ideal of $\mathbb Z[x]/(x^2)$, and
$2.$ For the same $p=(2)$, $\varphi^{-1}(2\mathbb Z[x]/(x^2))$ contains $x^2$ and so isn't equal to $2\mathbb Z$.
Here's how you want to proceed: prove that $f^{-1}(V(I))=V(IB)$. You have by definition
$$ \begin{align*} P\in f^{-1}(V(I))&\iff f(P)\in V(I)\\ &\iff \varphi^{-1}(P)\supseteq I \end{align*}$$
try to show this last condition is equivalent to $P\supseteq IB$, and hence equivalent to $P\in V(IB)$.