TITLE: Understanding the support of a function
QUESTION [10 upvotes]: This is from exercise 5.5.A of Vakil's lecture notes.
Consider $f$, a function on $A: = \mathrm{Spec}(k[x,y]/(y^2, xy))$. Show that its support either empty, the origin or the whole space.
Now, I know that the support of any function $f$ must be closed. This comes from the fact that its complement consists of points on which the germ of $f$ is zero. So the $f$ is also zero in a neighborhood of those points $\Rightarrow$ the complement of the support is open.
But then if we take in our case $f = (x-1)(x-2)$, why will the support not be the open set $\mathbb A^2_k- {1,2}$?
If we were doing differential geometry, we would take the support to be the closure of the non-vanishing set. But I didn't see such a definition anywhere in algebraic geometry.

REPLY [3 votes]: We approach the problem by investigating the stalks of this scheme and deducing which global functions may be supported at each point.
First observe that the prime ideals of $A$ are $(Y)$ and $\mathfrak{m}_a=(Y,X-a)$ for each $a \in k$, and that $A_{\mathfrak{p}} \cong k[X,Y]_{\mathfrak{p}}/(Y^2,XY)_{\mathfrak{p}}$ for each prime $\mathfrak{p}$. Thus if we think of an element of $A$ as being given by a polynomial $f(X,Y)$, then $f$ is supported at every point if it is not divisible by $Y$*. But any element of $A$ divisible by $Y$ may be represented by $f(X,Y) = cY$ for  some $c \in k$. But then this is supported exactly at $\mathfrak{m}_0$, unless $c = 0$ in which case it is supported nowhere.
Putting this together, we have three possibilities for $\operatorname{Supp}(f)$:
$i)$ $\phi$ if $f = 0$
$ii)$ $\{\mathfrak{m}_0\}$ if $f$ is a nonzero multiple of $Y$
$iii)$ $\operatorname{Spec(A)}$ if $f$ is not divisible by $Y$
We can in fact interpret this in terms of reducedness. We can think of reducedness as "remembering extra information", in this case the reducedness of the scheme at the origin is the scheme "remembering that it is part of the plane" at the origin (Vakil says something similar when he introduces this example). This is rather vague, but making this notion precise is part of the point of section $5.5$. One way to think about it is like this: consider the function $Y$ on two domains, the plane and the $X$-axis. This function on the plane vanishes precisely on the $X$-axis and nowhere else, so the germ of $Y$ as a function on the plane vanishes nowhere (since a germ vanishing at a point means that the function vanishes on some open set about this point). However, as a function simply on the $X$-axis, $Y$ is identically zero, so the germ of $Y$ vanishes everywhere. We think of $\operatorname{Spec}(A)$ as being the $X$-axis that "remembers that it lives in the plane at the origin", the germ of $Y$ unexpectedly fails to vanish at the origin, because there the scheme remembers that $Y$ doesn't vanish identically on any open set about the origin in the plane, even though these open sets aren't contained in our scheme at all.
*This may not be immediately clear, but we have that $(Y^2,XY)_{\mathfrak{p}} \subset (Y)_{\mathfrak{p}}$, and so any $f$ whose germ vanishes at $\mathfrak{p}$ must be divisible by $Y$. In fact, the containment above is actually an equality unless $\mathfrak{p} = \mathfrak{m}_0$, since if this doesn't happen, $X$ is a unit in the localised ring.