Let $A$ be a ring an $\mathfrak{p}$ a prime ideal. Let $\phi: A \to A_{\mathfrak{p}}$ be the canonical localization map and $\mathfrak{q}$ be a $\mathfrak{p}$-primary ideal (therefore $\sqrt{\mathfrak{q}}=\mathfrak{p}$). Why in this case holds following equality
$$\mathfrak{q} = \phi^{-1}(\mathfrak{q}A_{\mathfrak{p}})\ ?$$
I need only the $\phi^{-1}(\mathfrak{q}A_{\mathfrak{p}}) \subset \mathfrak{q}$ inclusion.
Background: The proof in https://en.wikipedia.org/wiki/Serre%27s_criterion_for_normality
Here was stated that this equality only holds because $\mathfrak{q}$ is $\mathfrak{p}$-primary but do we really need for this equation this property. I think that we only need the condition $\mathfrak{q}A_{\mathfrak{p}} \neq A_{\mathfrak{p}}$, but I don't see where we need here the primary property.
Here is some geometric intuition behind what is going on:
Geometrically, $\mathfrak{p}$ corresponds to the set of regular functions vanishing on some variety $X = Z(\mathfrak{p})$. $\mathfrak{q}$ being $\mathfrak{p}$-primary means that $\mathfrak{q}$ corresponds to to the set of regular functions vanishing on $X$ with certain multiplicities, i.e. with certain partial derivatives also vanishing on $X$. The map $\phi$ inputs a regular function and outputs its germ at $\mathfrak{p}$. In particular, $\phi^{-1}(\mathfrak{q} A_\mathfrak{p})$ will consist of all regular functions whose germs have zeroes of the right multiplicities at $X$, which is just the same as $\mathfrak{q}$.
If $\mathfrak{q}$ were not $\mathfrak{p}$-primary, then it would have a vanishing set other than $X$, so since $X$ is irreducible, its vanishing set $Y=Z(\mathfrak{q})$ would be empty or contain points outside $X$. If $Y$ contains points outside $X$, then we would lose information when we localize to $X$, so $\phi^{-1}(\mathfrak{q} A_\mathfrak{p})$ would be too big since it would contain some functions that fail to vanish on points of $Y$ outside $X$. If $Y$ is empty, then nullstellensatz gives that $\mathfrak{q}=A$, in which case the result still holds but is rather trivial.