Cohomology of the interior of a zero set of a smooth function Given a smooth function $f:\mathbb{R}^n \to \mathbb{R},$ how much is known about the cohomology of the interior of the zero set $f^{-1}\left(0\right)$? I know this can be quite wild, e.g. this amounts to computing the cohomology of the interior of any arbitrary closed subset of $\mathbb{R}^n,$ but is there any hope in describing this cohomology in terms of some properties of $f$?
 A: When $f$ is a Morse-Bott function, you may be able to deduce information about the Betti numbers of $f^{-1}(0)$ if you understand the critical sets of $f$.
A bit more generally, when $f$ is minimally degenerate, a notion due to Frances Kirwan, then you can do the same thing.
This may not help, in that it requires understanding all of the other critical sets!
There is one nice class of examples where this variant of Morse theory does work very well: when $f$ is the norm-square of a momentum map for a Hamiltonian $G$ action on a manifold $M$, then $f$ is minimally degenerate and $f^{-1}(0)$ is the $0$-level set of the momentum map.  The critical sets are subsets of fixed sets $M^T$ for certain abelian subgroups of $G$.  When $0$ is a regular value of the momentum map, $G$ acts locally freely on the level set, and the cohomology of the quotient $f^{-1}(0)/G$ can be computable.  I don't know if the cohomology of $f^{-1}(0)$ itself is computable, but when the $G$-action is free, you know that it is fiber bundle over the quotient $f^{-1}(0)/G$.
A reference:
Frances Kirwan, Cohomology of quotients in symplectic and algebraic geometry. 
Mathematical Notes, 31. Princeton University Press, Princeton, NJ, 1984.
A: It is a theorem of Whitney's that every closed subset $X$ of a smooth manifold $M$ is the zero locus of a smooth function on $M$. The idea of the proof is as follows: cover the complement $M\setminus X$ by a locally finite system of open balls with compact closures in $M\setminus X$ and let $(f_k)$ be the corresponding partition of unity. Set $$g_k=f_k\frac{1}{2^k}max_{|\alpha|\leq k,x\in M}\left|\frac{\partial^\alpha}{\partial x^\alpha}f(x)\right|.$$ Then as $k\to \infty$, for each fixed order $n$, each $x\in M$ and each $\alpha$ with $|\alpha|=n$ we will have $\left|\frac{\partial^\alpha}{\partial x^\alpha}g_k(x)\right|\leq \frac{1}{2^k}$, so $f=\sum g_k$ has the required property.
