Let $M$ be a smooth manifold and $f\in C^\infty(M)$. Let $S:=f^{-1}(\{c\})$ for some $c\in \operatorname{Im}(f)\subseteq\mathbb{R}$. When does exist a manifold $N$ with $\dim(N)<\dim(M)$ and a smooth immersion $\Phi :N\rightarrow M$ such that $\Phi (N)=S$? I guess that the interior of $S$ has to be empty.
Furthermore: when is $N$ unique up to dipheomorphism?
It's a well known result that if $c$ is a regular value then $S$ is a closed embedded hypersurface, so, in that line of thinking, probably you need to put some conditions to $c$, but I don't know which ones.
Partial answers are also welcome.
Thanks in advance.