Let $M$ be a compact ($\mathcal{C}^2$) hypersurface of $\mathbb{R}^k$. Then $M$ is the global level set of a function $f$ having $0$ as a regular value (see this related question).
I think that $f$ can be constructed using the Jordan-Brouwer theorem and the tubular neighborhood theorem. (Define $f$ to be a signed distance to $M$, negative in the bounded connected component of $\mathbb{R}^k \backslash M$.)
But is there a more elementary proof of this?