Topological boundary of a specific manifold. Let $\emptyset\neq X\subset\mathbb{R}^n$, $n\ge2$, be an $(n-1)$-dimensional differentiable submanifold, i.e. for every $p\in X$ there is an open $U_p\subset\mathbb{R}^n$ with $p\in U_p$, and a differentiable map $f:U_p\to\mathbb{R}$ such that $f^{-1}(0)=X\cap U_p$ and $rk(Df(p))=1$. Suppose that $X$ has the following property:
There exists an open $U\subset\mathbb{R}^n$ with $X\subset U$, and a differentiable function $g:U\to\mathbb{R}$ s.t. $X=g^{-1}(0)$ and $Dg(p)\neq0$ for all $\in X$.
Now the questions asks to show that $X$ is the topological boundary in $U$ of $A:=\{p\in U\,|\,g(p)<0\}$.
My first take is always to show both inclusions...but:
When starting with $p\in\partial A$, we must show that $p\in X$, i.e. $f(p)=0$. We know that for all $N\in\mathcal{N}_p$ it holds that $N\cap A\neq\emptyset$ and $N\cap(U\setminus A)\neq\emptyset$. So, for any open $U$ around $p$ there exist $p_1,p_2\in U$ such that $f(p_1)<0$ and $f(p_2)>0$. I guess that $f$ has to switch signs somewhere because of this, but I'm stuck on how to prove this, and also the other inclusion. Any help is appreciated.
EDIT I have added an answer, and would appreciate any comments on the proof.
 A: Let's attack this more conceptionally, less point-wise.
Your map $g$ is continuous, hence it divides your space $U$ into 3 components, namely $U_\pm = g^{-1}(\mathbb R_\pm)$  which are open and $X$ which is closed, i.e. we write $U$ as disjoint union
$$ U= U_+ \sqcup X \sqcup U_-.$$
By this we have that both $U_\pm \sqcup X = U _ \mp^c$ are closed with intersection contained in $X$ (by disjointness). Hence $\partial U_+ \subset X$.
Now is the point where the differentiability comes in! It tells you that $X$ is 1-codimensional, which means that every open ball around a point in $X$ hits $U_+$, hence $X \subset U_+$.
Another way to argue is for $p\in X$ it is $Dg(p) \neq 0$, hence there is $\epsilon_0$, such that 
$\forall \epsilon < \epsilon_0 :g(B_\epsilon(p))$ is open hence
$$\forall \epsilon < \epsilon_0 :g(B_\epsilon(p))\cap \mathbb R_+ \neq 0,$$
which means $X\subset U_+$.
A: With the help of the answer by @Daniel Valenzuela and some more work, I have come up with the following solution, which doesn't seem to use the fact that $f$ is differentiable (and I think this makes sense since this is a topological property we are proving) (OP appreciates any comments).
Clearly, $X=g^{-1}(0)$ is closed in $U$, and $A=g^{-1}((-\infty,0))$ and $B:=g^{-1}((0,\infty))$ are both open in $U$, since $f$ is continuous. It is clear that $U=X\sqcup A\sqcup B$, and also that $(X\sqcup B)^\circ=B$. Then, since $(U\setminus A)^\circ=U\setminus\overline{A}$, it follows that $U\setminus\overline{A}=(X\sqcup B)^\circ=B$, so $\overline{A}=X\sqcup A$. As $A$ is open, $A=A^\circ$, and it follows that $\partial A=\overline{A}\setminus A^\circ=(X\sqcup A)\setminus A=X$. Am I missing something?
