Let $f(X)\geq 0$ be a nonconvex $C^\infty$ function: $\mathbb R^3\to \mathbb R$.

Give any fixed $X_0$ such that $f(X_0)=\epsilon^+$, and the level set: ${L}=\{X\in \mathbb R^3:f(X)\leq \epsilon^+\}$ is a convex set.

And $\forall X_0$, $L$ is always a convex set.

Then what is the necessary and sufficient conditions, for $f(X)$ to be locally convex on ${L}$? (A mild sufficient condition would also be OK).

The sufficient condition better be easily (e.g. numerically) verifiable.