TITLE: The support and the non-vanishing set of a function on a scheme
QUESTION [5 upvotes]: I have some confusion regarding the two concepts:
Let $(X,\mathscr{O}_X)$ be a scheme, let $f\in \Gamma(\mathscr{O}_X,X)$ and define the support of $f$ to be
$$\operatorname{Supp}(f) : = \{p\in X: 0\ne f\in\mathscr{O}_{X,p}\}.$$
But we can also define the non-vanishing set of $f$ as
$$NV(f): = \{p\in X: f\not\in \mathfrak{m}_p \text{ the unique maximal ideal of }\mathscr{O}_{X,p}\}.$$
We clearly have $NV(f)\subset \operatorname{Supp}(f)$. Now $NV(f)$ is open and $\operatorname{Supp}(f)$ is closed. How do I understand these two concepts intuitively?

REPLY [5 votes]: One source of intuition would be the analogous situation where $(X,\mathcal O_X)$ is an open subset  $X\subset \mathbb C$ endowed with its sheaf of holomorphic functions .
Then a section $f\in \Gamma(X,\mathscr{O}_X)$ is a holomorphic function and for a point $z\in X$ we have: $$z\in NV(f)\iff f(z)\neq 0\\ z\in \operatorname {supp} f\iff \exists k\geq 0:\frac {d^kf}{dz^k}(z)\neq 0$$ For $X$ connected and $f\neq 0$ we always have $\operatorname {supp} f=X$ whereas $ NV(f) $ may be much smaller: it can have an infinite (but discrete) complement $X\setminus NV(f)=V(f)$.  
To come back to the case of a scheme, we have in a similar vein:  if $X$ is an integral scheme and if $0\neq f\in \Gamma(X,\mathscr{O}_X)$, then $\operatorname {supp} f=X$.
However in general $NV(f)$  will not be the whole of $X$: if for example $X=\mathbb A^n_k$ is affine space over an algebraically closed field, then any non-constant polynomial $f\in k[T_1,\dots,T_n]\setminus k$ is a function $f\in \Gamma(X,\mathscr{O}_X)$ with $NV(f)\neq X$.
Note that, very generally, the global functions $f\in \Gamma(X,\mathcal O_X)$ with $NV(f)=X$ form the group $\Gamma(X,\mathcal O_X^*)$ of invertible functions on $X$.