On a *ringed space*, show that the non vanishing set of $f$ is open, and that it is invertible there

There is a subtle and interesting point in this context that one really has to understand:
let me try to be as clear as possible rather than concise.

a) Let $(X,\mathscr O_X)$ be a ringed space that is not necessarily locally ringed.
Then given $f\in \mathscr O_X(X)$, we can ask whether the germ $ f_x\in \mathscr O_{X,x}$ at $x\in X$ is invertible i.e. if $f_x\in \mathscr O_{X,x}^\star$.
Note carefully that the ring $\mathscr O_{X,x}$ is absolutely arbitrary and should not be assumed local.

In this set-up the set of points $x\in X$ with $f_x\in \mathscr O_{X,y}^\star$ is open:
Indeed if $f_x\in \mathscr O_{X,x}^\star$ there exists a germ $g_x$ with $f_xg_x=1\in \mathscr O_{X,x}$ and thus on a suitable open neighbourhood $U$ of $x$ there exists a representative $g\in \mathscr O_X(U)$ of $g_x$ satisfying $f|U\cdot g=1\in \mathscr O_X(U)$.
It is then clear that for all $y\in U$ we also have $f_y\in \mathscr O_{X,y}^\star$ since $f_y\cdot g_y=1\in \mathscr O_{X,y}$ : the promised openness has been proved .

As a digression, let me add that the reasoning above easily implies (by covering $X$ by suitable open $U$'s and using the unicity of inverses in a ring) that a global section $f\in \mathscr O_X(X)$ is invertible if and only if all its germs are invertible: $$f\in \mathscr O_X(X)^\star \iff (\forall x\in X) \; f_x\in \mathscr O_{X,x}^\star \quad (\bigstar)$$

$\\$

b) Suppose now that $(X,\mathscr O_X)$ is a locally ringed space.
Each point $x\in X$ then acquires a residue field $\kappa(x)= \mathscr O_{X,x}/\mathfrak m_x$ and a function $f\in \mathscr O_X(X)$ now receives a value $f(x)=\text {class} (f_x) \in \mathscr O_{X,x}/\mathfrak m_x=\kappa(x)$.
This value is close to the classical interpretation of the value of a function but it is crucial to understand the enormous difference between $f_x$ and $f(x)$.
The charm of local rings is that invertibility of $f_x$ is now exactly equivalent to the rather concrete requirement of having non-zero value: $$f_x\in \mathscr O_{X,x}^\star \iff f(x)\neq 0\in \kappa(x) \quad \quad (\bigstar \bigstar) $$ In particular, taking $(\bigstar)$ into account, we get: $f\in \mathscr O_X(X)^\star \iff (\forall x\in X) \; f(x)\neq 0\in \kappa(x)$

$\\$

c) So the set of points where $f(x)\neq 0$ is open thanks to the above equivalence $(\bigstar \bigstar)$ and the openness result in a).
As an aside, I find it a little intriguing that the trivial-looking assertion of openness of $f(x)\neq 0$ requires such a roundabout proof.


When he says function, he refers to any $f \in \mathcal{O}_X(U)$

1) No, $\mathcal O_X$ is just a sheaf and $f$ need not be a function at all.

2) To vanish at $p$ means that the germ $[f]_x$ is in the maximal ideal of the local ring $\mathcal O_{X,p}$

3) To be invertible at $p$ means that the stalk $[f]_x$ is in $\mathcal O_{X,p}^*$, a unit.

Now:

If $f$ is invertible at $p$ means that $[f]_p [g]_p=[1]_p$. By the definition this holds on a open nhood $f|_V g|_V = 1|_V$ so that the invertible locus is open.

Now if $\mathcal O_{X,p}$is a local ring and $[f]_x$ does not vanish, so $[f]_x \notin \mathfrak{m}_x$ is invertible