Let $M$ be a manifold and $N\subset M$ be a codimension-1 submanifold. Is it possible to find a function $H: M\rightarrow \mathbb{R}$ such that $N\subset H^{-1}(a)$ for some regular value a of $H$?.
If it exists, what is necessary condition for $N=H^{-1}(a)?.$
I have no idea how to proceed it.
Thanks, advance.
As Ted Shifrin remarks, it follows that $N$ has a trivial normal bundle: The tangent space at the regular value pulls back to the normal bundle along $N$ and hence is trivial.
Suppose therefore that $N$ has an orientable normal bundle: Then a neighborhood of $N$ has the form $U\cong: N\times (-\epsilon,\epsilon)$. Define $H:U\rightarrow \mathbb R$ via $H(x,t)=t$ and extend it to $M$. Up to a small perturbation outside of $U$ you can assume $H$ has $0$ as a regular value, and it follows that $N\subseteq H^{-1}(0)$.
Now if $M$ and $N$ are connected and $M\setminus N$ has two components then you can extend $f$ to be positive on one component, and negative on the other. In this case $N=H^{-1}(0)$. This is a necessary condition: If $M$ and $N$ are connected and $M\setminus N$ is connected as well you can choose a path from a point $(x,-\epsilon/2)$ to $(x,\epsilon/2)$ that does not traverse $N$. But on this path $H$ assumes both positive and negative values. The intermediate value theorem implies that $H$ must be zero somewhere along this path.
The situation sketched above occurs on the two torus: Take for $N$ a small loop bounding a disc, or take a loop that does not bound a disc.