One condition, (2) of Definition 25.4.1, for a morphism of ringed spaces $i:Z\rightarrow X$ to be a closed immersion is that $$O_X \rightarrow i_*O_Z$$
is surjective.
I have two confusions
(a) $i^*O_X \rightarrow O_Z$ is surjective does this show $O_X \rightarrow i_*O_Z$ is surjective? This doesn't seem to be the case for me. The counit of $i^*,i_*$ doens't seem to be special.
(b) I could prove $(i^*O_X)_x=O_{X,i(x)}$ but is it the case $(i_*O_Z)_{i(z)}=(O_Z)_{z}$?
I do not see why both cases have to be true, it would be nice if a counter example is provided too.