This is an exercise of Ravi Vakil that I solved by a very trivial argument without using the hint. For this reason I'm worried that I might have missed something.
If $f$ is a function on a locally ringed space $X$, show that the subset of $X$ where $f$ doesn't vanish is open. (Hint: show that if $f$ is a function on a ringed space $X$, show that (sic) the subset of $X$ where the germ of $f$ is invertible is open)
Solution: Assuming that the first sentence means "$f$ is an element of $\mathcal O_X$", and that $\mathcal O_X$ is a ring of continuous functions on $X$, we just pull back the closed set $\{0\}$ to $X$ via $f^{-1}$. Under a continuous function the pull back of a closed set is closed, and therefore the complement of the locus where $f$ doesn't vanish is closed.
Questions:
1) is my solution correct?
2) I know it is true for the special example of schemes, but for a ringed space in general why is the locus of where a function $f$ doesn't vanish the same of where the germ of $f$ is invertible? The most I can say is that this is true for locally ringed spaces (and not for just ringed spaces as the hint suggests), because if the germ of a function is non-zero at a point $p$ in a locally ringed space $X$, $f_p$ can't belong to the maximal ideal $\mathfrak m_p$. For if it did, then under the homomorphism $ev_p: \mathcal O_{X,p} \rightarrow k$ the maximal ideal of $k$, which is $(0)$, would not pull back to $\mathfrak m_p$ (it would miss $f_p$).