Is there difference between support of function and support of module? Let $A$ be a commutative ring, and $M =A$ can be treated as an $A$-module. Let $f\in A$ we have the submodule $(f) \subset A$ therefore we can consider the support of the module $(f)$, which is :
$$\text{supp} ((f)) = \{p\in \text{Spec} A\mid (f)_p \ne 0\} \tag{1}$$
where $(f)_p$ means taking the localization of the module $(f)$ at $p$.
There is another definition of support since $f \in A = \mathcal{O}(\text{Spec} A)$ the support of function $f$ can also be defined as ：
$$\text{supp}(f) = \{p\in\text{Spec} A \mid f(p) \ne 0\} \tag{2}$$
Where $f(p)$ means the image of $f$ in the residue field via the canonical map $$A\to A_p\to A_p/(pA_p) = \kappa(p)$$

I am not sure, but I found these two different definitions of support are different, in the first one by this post in stack project thereom 10.40.7 which shows if we use definition (1), we have

Lemma 10.40.7. Let $A$ be a ring, let $M (= A)$ be an $A$-module, and let
$f\in A$. Then $p\in V(\text{Ann}(f)) = \text{supp} ( (f))$ if and only if $f$ does not map to
zero in $A_p$.

However in definition (2): $f(p) \ne 0$ iff $f$ does not map into the maximal ideal $pA_p$ in the local ring $A_p$.
You see one is equivalent to not mapping to zero another one is not mapped to the maximal ideal. Are these two definitions of support different?
 A: Yes they are different, and I was also confused by this when I first noticed.
By Hartshorne Exercies II.2.16.(a) we actually have $\operatorname{supp}(f)=D(f)$, i.e. the set of primes not containing $f$. And by your Lemma we have $\operatorname{supp}((f))=V(\operatorname{Ann}(f))$. So the former is open, while the latter is closed. Also, it is clear from the definition that $D(f)\subseteq V(\operatorname{Ann}(f))$. It is then natural to ask if we always have $\overline{D(f)}=V(\operatorname{Ann}(f))$. But this may fail, for example if $A=k[\epsilon]=k[x]/(x^2)$ and $f=\epsilon$. It may even fail if $f$ is non-nilpotent: take $A=k[x,y]/(xy^2)$, denote by $\overline{x},\overline{y}$ the classes of $x,y$ in side $A$ and let $f=\overline{y}$. Then $\overline{D(f)}=V(\overline{x})$, while $\operatorname{Ann}(f)=(\overline{x}\overline{y})\subseteq \sqrt{(0)}$ and thus $V(\operatorname{Ann}(f))=\operatorname{Spec}A$.
What we can say in general is the following: define $\operatorname{Ann}(f^{\infty}):=\bigcup_{n\geq 1}\operatorname{Ann}(f^n)$ (this is an ideal as it is an increasing union). Then
$$
\overline{D(f)}=V(\operatorname{Ann}(f^{\infty}))=\bigcap_{n\geq 1}\operatorname{supp}((f^n)).
$$
Note also that if $A$ is reduced, then $\operatorname{Ann}(f^{\infty})=\operatorname{Ann}(f)$, because if $xf^n=0$ for some $n>0$ then $(xf)^n=0$ and hence $xf=0$. So in this case we do have $\overline{D(f)}=V(\operatorname{Ann}(f))$.
