When will level sets be closed/Jordan curves? Are there any conditions on a $C^{1}$ function $f$, for example from $\mathbb{R}^2$ to $\mathbb{R}$, and constant $c$ which would guarantee that the level set $\left\{(x,y) \in \mathbb{R}^2: f(x,y)=c\right\}$ is a closed curve? By "closed curve" I mean a curve which is a closed loop (homeomorphic to the circle), rather than merely a curve which, seen as a set of points, is a closed set (as discussed in comments here: Do the curves of a level set of a continuous function have to be closed?).
Similarly, what about conditions for the level set to be a simple (non-self-intersecting) closed curve, i.e. a Jordan curve in the plane?
 A: If you haven't studied manifolds yet then this answer is going to be a little rough, in that it will use some of the more sophisticated tools about smooth submanifold of $\mathbb R^n$ including Morse Theory.
Here goes.
One list of condidions that guarantees your level set is a Jordan curve is:

*

*$f$ is smooth,

*$f$ is proper,

*$f$ has a unique critical point $(x_0,y_0) \in \mathbb R^2$. I'll denote
$$b = f(x_0,y_0)
$$

*$c \in \text{image}(f) - \{b\}$.

*The critical point $(x_0,y_0)$ is a Morse singularity of $f$. This just means that the matrix of second partial derivatives of $f$ at $(x_0,y_0)$ has nonzero determinant.

Here's a few details of proof.
The Regular Value Theorem (aka the Submersion Theorem), together with 2, 3, and 4, implies that $f^{-1}(c)$ is a 1-dimensional submanifold of $\mathbb R^2$ for all $c \in \text{image}(f) - \{b\}$. Combining this with 1 it follows that $f^{-1}(c)$ is a compact 1-dimensional submanifold, which in turn implies that $f^{-1}(c)$ is a union of a disjoint collection of Jordan curves. Let's denote the number of components of $f^{-1}(c)$ number by $N(c)$. A further application of the Regular Value Theorem implies that $N(c)$ is locally constant: for each $c$ there exists $\epsilon>0$ so that if $c-\epsilon < c' < c+\epsilon$ then $N(c')=N(c)$.
So it remains to check that $f^{-1}(c)$ is just a single Jordan curve, in other words that $N(c)=1$ for all $c \in \text{image}(f) - \{b\}$.
The Morse Lemma, applied to $f$ and $b$, implies that $N(c)=1$ if $c$ is close to $b$.
Applying the Intermediate Value Theorem to $N(c)$ together with the fact that $N(c)$ is locally constant, it follows that $N(c)$ is constant. Knowing that $N(c)=1$ at values close to $b$, it follows that $N(c)=1$ for all values of $c$.
