Let $\varphi: A \rightarrow B$ be a ring homomorphism. Let $f =\mathrm{Spec}(\varphi) : \mathrm{Spec}(B) \to \mathrm{Spec}(A)$ be the map associated to $\varphi$.
Why is the map $f$ is continuous?
I think we need to use $IB$ (the ideal of $B$ generated by $\varphi(I)$).
Then we got $f^{-1}(V(I)) = V(IB)$. (why?)
Could someone tell the details of this proof? Thank you :)
Yes, $f^{-1}(V(I))=V(\phi(I) B)$ is true, and this is straight forward to prove (you should try it).
Alternatively, it suffices to prove that $f^{-1}(D(a))=D(\phi(a))$, and this is because
$$\mathfrak{p} \in f^{-1}(D(a)) \Leftrightarrow a \notin f(\mathfrak{p}) = \phi^{-1}(\mathfrak{p}) \Leftrightarrow \phi(a) \notin \mathfrak{p} \Leftrightarrow \mathfrak{p} \in D(\phi(a)).$$