The support and the non-vanishing set of a function on a scheme 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?
 A: 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$.
A: Since it is intuition we are after, let us consider real valued functions on the real line. Consider the stalk at $0$. As always, it is a local ring, with maximal ideal consisting of functions which vanish at $0$. Let $f:\mathbb{R}\to\mathbb{R}$ be given by $f(x)=x$. Then $f$ represents an element in the maximal ideal at $0$. However, since there is no neighborhood of $0$ on which $f$ vanishes, $f$ does not represent the $0$ element.
A: One thing that always confused me is why the support is closed, until I realized that yes if the image of $f$ in $\mathcal{O}_{X,p}$ is 0, then of course it vanishes at $p$, but being 0 in the stalk furthermore means that it's 0 in some open neighborhood of $p$! (recall the definition of stalk). Thus, being 0 in the stalk means it's locally zero, which of course is an open condition.
Nonvanishing I think is much more intuitive and probably doesn't need an explanation. It's just the set of points where $f$ doesn't vanish. If you think of $f$ as a continuous function to say, a field $K$, then the nonvanishing is just the preimage of $K - \{0\}$, which is open, so the nonvanishing is open.
