An element of $R$ should be seen as a function on $X=\operatorname {Spec} R$.
This is the fantastic vision of Grothendieck, which turns an arbitrary ring into a ring of regular functions on $X$, namely : $R=\Gamma (X,\mathcal O_X)$.
The value of the "function" $r\in R$ at $x\in X$ is $r[x]:=[r]_{\mathfrak p_x}\in \operatorname {Frac}(R/\mathfrak p_x)=\kappa(x)$.
Hence the condition that $r$ vanish at $x$ is: $r[x]=0\iff r\in \mathfrak p_x$, and the condition that $r$ vanish at all points $y\in Y$ is thus $r\in \bigcap_{y\in Y}\mathfrak p_y$.
The Zariski topology is such that its closed sets are given by the vanishing of a family of functions and thus it is quite intuitive that the closure of $Y$ is given by the the vanishing of the functions $r\in \bigcap_{y\in Y}\mathfrak p_y$.
In other words $$\overline Y=\{x\in X\vert r[y]=0 \operatorname {for all } y\in Y\}=V( \bigcap_{y\in Y}\mathfrak p_y)$$ which is your formula.
An Analogy
Actually the formula is quite natural and its analogue already exists in elementary calculus!
The closure of the interval $(0,1)\subset \mathbb R$ is exactly the common zero set of all functions vanishing on $(0,1)$: $$[0,1]=\overline {(0,1)}=\bigcap_{ \{f\in C(\mathbb R)\vert f (x)=0 \operatorname {for all} x\in (0,1)\} }f^{-1}(0)$$
Let $\phi \colon A \to B$ be a ring homomorphism, $X = \text{Spec}(A)$, $Y = \text{Spec}(B)$, and $\phi^* \colon Y \to X$ the induced mapping of $\phi$.
The exercise says that if $\phi$ is surjective, then $\phi^*$ is a homeomorphism of $Y$ onto the closed subset $V(\ker \phi)$ of $X$, or in more formal terms, the map
\begin{align*} \newcommand{\q}{\mathfrak{q}}
Y & \stackrel \Phi \longrightarrow V(\ker \phi) \\ \q & \longmapsto \phi^*(\q)
\end{align*}
is a homeomorphism.
First of all, why is $\Phi$ well-defined? That is, given $\q \in Y$, why is $\phi^*(\q)$ an element of $V(\ker \phi)$? Well, that’s easy: applying the inverse image to the inclusion $0 \subseteq \q$ we get that $\ker \phi = \phi^{-1}[0] \subseteq \phi^{-1}[\q] = \phi^*(\q)$.
Second, $\Phi$ is continuous because $\phi^*$ is (due to the universal property of the subspace topology, basically).
Next, you state that the map
\begin{align*} \newcommand{\p}{\mathfrak{p}} V(\ker \phi) & \stackrel \Psi \longrightarrow Y \\ \p & \longmapsto \phi[\p]
\end{align*}
is the inverse of $\Phi$. This is true, but it requires a little more work than you did.
Again, we need to prove that $\Psi$ is well-defined: given $\p \in V(\ker \phi)$, we need to prove that $\phi[\p]$ is an element of $Y$, that is, a prime ideal of $B$.
- Since $\phi$ is surjective, the image $\phi[\p]$ is an ideal of $B$.
- Take $x,y \in B$ with $xy \in \phi[\p]$. Then $xy = \phi(p)$ for some $p \in \p$.
Moreover, there are $x’,y’ \in A$ with $\phi(x’) = x$ and $\phi(y’) = y$.
Hence $\phi(x’y’) = \phi(p)$, and that means $x’y’-p \in \ker \phi$.
Finally, as $\ker \phi \subseteq \p$, it follows that $x’y’-p \in \p$, and consecuently $x’y’ \in \p$, from which we can conclude that $x’$ or $y’$ is in $\p$, so that $x$ or $y$ is in $\phi[\p]$.
Now, why is $\Psi$ continuous? If $g \in B$, I will leave to the reader to prove that
$$
\Psi^{-1}[Y_g] = X_f \cap V(\ker \phi),
$$
where $f$ is any element of $A$ with $\phi(f)=g$ ($\phi$ is surjective!).
Hence, the inverse image of any open basic subset of $Y$ is an open subset of $V(\ker \phi)$; so, $\Psi$ is continuous.
Finally, let see that $\Phi$ and $\Psi$ are, indeed, inverses to each other:
- As $\phi$ is surjective, $\phi[\phi^{-1}[\q]] = \q$ for any $\q \in Y$; so $\Psi \circ \Phi = \text{id}$.
- Using only the additivity of $\phi$, it can be shown that
$$
\phi^{-1}[\phi[S]] = S + \ker \phi
$$
for any subgroup $S$ of $A$.
Therefore, $\phi^{-1}[\phi[\p]] = \p$ for every $\p \in V(\ker \phi)$; i.e. $\Phi \circ \Psi = \text{id}$.
Best Answer
First, I will make some statements without proof. For an ideal $\mathfrak{a} \unlhd A$, $\sqrt{\mathfrak{a}} = \cap_{\substack{p \in Spec(A) \\ p \supset a}} p$. Also, $V(\mathfrak{a}) \subset Spec(A)$ is a closed set for any $\mathfrak{a} \unlhd A$. Lastly, for $\phi : A \rightarrow B$ a ring homomorphism, $\mathfrak{a} \unlhd A$, we have $(\phi^{*})^{-1}(V(\mathfrak{a})) = V(\mathfrak{a}^{e})$, where $\mathfrak{a}^{e} \unlhd B$ is the ideal generated by the image of $\mathfrak{a}$. We want to show $(\overline{\phi^{*}(V(\mathfrak{b}))}) = V(\mathfrak{b}^{c})$.
$\boxed{ \subseteq }$ Suppose that $x \in \phi^{*}(V(\mathfrak{b}))$. Then there is $y \in V(\mathfrak{b})$, $\phi^{*}(y) = x \implies x = y^{c}$. But $y \supseteq \mathfrak{b} \implies x = y^{c} \supseteq \mathfrak{b}^{c} \implies x \in V(\mathfrak{b}^{c})$. Since $\mathfrak{b}^{c} \unlhd A$, $V(\mathfrak{b}^{c})$ is closed, which implies $\overline{\phi^{*}(V(\mathfrak{b}))} \subseteq V(\mathfrak{b}^{c})$
$\boxed{ \supseteq }$ Observe that $\overline{\phi^{*}(V(\mathfrak{b}))} \subseteq Spec(A)$ is closed, so $\overline{\phi^{*}(V(\mathfrak{b}))} = V(\mathfrak{a})$, for some $\mathfrak{a} \unlhd A$. Then: $$ V(\mathfrak{a}^{e}) = (\phi^{*})^{-1}(V(\mathfrak{a})) = (\phi^{*})^{-1}(\overline{\phi^{*}(V(\mathfrak{b}))}) \supseteq V(\mathfrak{b}) $$ which implies that $\mathfrak{a}^{e} \subseteq \sqrt{\mathfrak{b}}$. Let $t \in \mathfrak{a}$, then $\phi(t) \in \mathfrak{a}^{e} \subseteq \sqrt{\mathfrak{b}}$. Then $\phi(t^{n}) = \phi(t)^{n} \in \mathfrak{b}$ for some $n \in \mathbb{N}$. So $t^{n} \in \mathfrak{b}^{c} \implies t \in \sqrt{\mathfrak{b}^{c}} \implies \mathfrak{a} \subseteq \sqrt{\mathfrak{b}^{c}}$. So: $$ \overline{\phi^{*}(V(\mathfrak{b}))} = V(\mathfrak{a}) \supseteq V(\sqrt{\mathfrak{b}^{c}}) = V(\mathfrak{b}^{c}) $$ which completes the proof. Let me know if you have questions.