In his notes, Ravi Vakil says that:
An affine scheme is a ringed space that is isomorphic to $(\operatorname{Spec}A,\mathscr{O}_{\operatorname{Spec}A})$ for some $A$.
However, it seems to me that the usual definition is slightly different:
An affine scheme is a locally ringed space that is isomorphic to $(\operatorname{Spec}A,\mathscr{O}_{\operatorname{Spec}A})$ for some $A$.
Lets assume Vakil's definition. I know that $\operatorname{Spec} A$ is a locally ringed space and so it follows that any affine scheme is a locally ringed space. What is not obvious to me is why the isomorphism is an isomorphism of locally ringed spaces. In other words, if $(f,f^{\#})$ is the isomorphism between our affine scheme and $\operatorname{Spec} A$, why is $f^{\#}$ local?