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.
First, as the pullback of the structure sheaf is the structure sheaf, the answer to (a) is that the natural map $i^*\mathcal{O}_X\to \mathcal{O}_Z$ is always an isomorphism for any morphism of schemes. So you're right to be suspicious here.
Second, $(i_*\mathcal{O}_Z)_{i(z)} = \mathcal{O}_{Z,z}$ is true. You can find this result on wikipedia or in most introductory algebraic geometry books. The point is that we can combine the definition $\Gamma(U,i_*\mathcal{F})=\Gamma(U\cap Z,\mathcal{F})$ for any open $U\subset X$ and any sheaf $\mathcal{F}$ on $Z$ with the fact that $Z$ has the subspace topology and every open set in $Z$ comes from the intersection of some open set in $X$ with $Z$.