$\newcommand{\Spec}{\operatorname{Spec}}$I'm looking at the proof of Corollary $8.3.5$ in Vakil's FOAG, which is to show that under certain conditions, the closure of the set-theoretic image of a scheme morphism $\pi:X\to Y$ is the scheme-theoretic image. The first step in this is to see, of course, that the set-theoretic image is indeed contained in the scheme-theoretic image. Vakil asks the reader to check this, so it must not be too complicated, but I'm having trouble proving it.
The scheme-theoretic image is described as follows: for a closed subscheme $i:Z\hookrightarrow Y$, we say the image of $X$ lies in $Z$ if $\mathscr J_{Z/Y}\to\mathscr O_Y\to\pi_*\mathscr O_X$ is exact, where $\mathscr J_{Z/Y}$ is the sheaf of ideals induced by $Z$. We get the scheme-theoretic image by taking the intersection over all such $Z$.
So all we need to show is that if we have such a $Z$, and $p\in X$, then $\pi(p)\in Z$. If we choose an affine open set $\Spec B$ containing $\pi(p)$, then by definition of $X$ lying in $Z$, we have
$$\mathscr J_{Z/Y}(\Spec B)=\ker(B\to\mathscr O_X(\pi^{-1}\Spec B))$$
If we let $I(B)=\mathscr J_{Z/Y}(\Spec B)$, then we note that $Z=\cup \Spec B/I(B)$ as $\Spec B$ runs over all affine open subsets of $Y$, so we just need to show that if $\pi(p)$ corresponds to the prime ideal $\mathfrak q$ of $B$, then $\mathfrak q\supseteq I(B)$.
I feel this should just be an unraveling of definitions, but I'm not seeing it. Can anybody help?