Solution (source code)

= Solution

Suppose the immersed subset is not embedded. Using the assumed embedded neighborhoods, there are $p\in N$, a relatively small coordinate neighborhood $U\ni p$, and points $p_j\in N\setminus U$ with $p_j\to p$ in $M$. Choose a <smooth bump function>[bump function] $g$ on $N$, supported in $U$, with $g(p)=1$. Then $g(p_j)=0$.

If $g=f|_N$ for some smooth $f$ on $M$, continuity gives both $f(p_j)\to f(p)=1$ and $f(p_j)=0$, a contradiction. Thus the extension hypothesis forces the subspace and manifold topologies to agree locally, and the immersion is an embedding. This proves the <smooth extension criterion for an immersed submanifold>.