It suffices to check the condition for an atlas of patches - checking for a single patch $\sigma$ shows that $f$ is a local isometry on the image of $\sigma$, so to show that $f$ is a local isometry everywhere you need to check a collection $\Sigma$ of patches that cover the surface. Once you have this then the result for arbitrary patches follows per James' comment:
For any other patch $\sigma$ you can cover the image of $\sigma$ with patches $\{\sigma_i\}\subset\Sigma$ with corresponding transition functions $\phi_i = \sigma_i^{-1} \circ \sigma$, and thus for any vectors $u,v$ based at a point in $\sigma$ there is an $i$ such that the patch $\sigma_i$ contains the base point. The action of the first fundamental form of $f \circ \sigma= f\circ \sigma_i \circ \phi_i$ on these vectors is thus
$$
\begin{align}
g_{f\circ \sigma}(u,v) &= \langle df \circ d\sigma_i (d\phi_i (u)), df \circ d\sigma_i (d\phi_i (v)) \rangle \\
&= g_{f \circ \sigma_i}(d\phi_i(u), d\phi_i(v))\\
&= g_{\sigma_i}(d\phi_i(u), d\phi_i(v))\\
&= g_{\sigma_i \circ \phi_i}(u,v) = g_{\sigma}(u,v)
\end{align}$$
where we use the fact that $\sigma_i$ and $f \circ \sigma_i$ have the same first fundamental form to go from the second to the third line.