Intuition
Draw a picture. At a tangent space, visualize tangent vectors and the result of projecting those tangent vectors to the $z$ axis. Do you see what are the (hint: only two) points such that the projection is not surjective?
Computation
We know that $f$ is actually the restriction of the projection map $F:\mathbb{R}^3\to \mathbb{R}$ taking $(x,y,z)\mapsto z$. Compute the differential of $F$, call it $dF$. Don't think too hard about this.
Now recall that the tangent space to $S^2$ at a point $p$ can be identified with the plane of vectors in $\mathbb{R}^3$ perpendicular to $p$. (Why?) Given a $p\in S^2$, compute a basis for $T_pS^2$.
Compute the matrix for $df_p$ by restricting $dF$ to the tangent space (which you know, as you have a basis).
What are the points where this map is not onto?