Conditions for level sets to be closed curves Im wondering if there is any result to guarantee that the level sets of a function $f:\mathbb{R}^2\rightarrow \mathbb{R}$ are closed curves?
Specifically if $f\in C^1(\mathbb{R^2},\mathbb{R})$ and the level set $\{(x,y)\mid f(x,y) = C\}$ is connected and contained in some ball, does this imply that the level set is a closed curve? If not what further conditions could one place to guarantee this, would convexity work?
I have tried to find some result concerning this in my textbooks and online but could not find anything concerning this.
 A: Let $\Omega\subset{\mathbb R}^2$ be the domain of $f$, and let $$K:=\bigl\{(x,y)\in\Omega\bigm| \nabla f(x,y)=(0,0)\bigr\}$$
be the set of critical points of $f$. In many cases the set $K$ is a finite set of isolated points in $\Omega$, see below. If $(x_0,y_0)\in\Omega\setminus K$ and $f(x_0,y_0)=C_0$ then $(x_0,y_0)$ lies on the level set $N_{C_0}$ of $f$. Furthermore the implicit function theorem guarantees that $N_{C_0}$ is a $C^1$-curve in the neighborhood of $(x_0,y_0)$. If you have control over $K$ and know that your level sets are bounded you can say that for $C\notin f(K)$ the level set $N_C$ is a closed curve.
But there are other examples: The function $f$ could be $\equiv1$ in the unit disc, then smoothly decrease to $0$ when $r:=\sqrt{x^2+y^2}$ goes from $1$ to $2$, and finally be $\equiv0$ for $r\geq2$. In this case the level set $N_1$ is a full disc, and the level set $N_0$ consists of all points $(x,y)$ with $r\geq2$.
The decisive assumption on $f$ therefore is that all critical points of $f$ should be nondegenerate, i.e., that the Hessian of $f$ at these points has rank $2$. This makes sure that $K$ consists of isolated points.
