A function with convex level sets but is not a convex function I have the function $$f(x)=\sqrt{|x|},$$ with $x\in\mathbb{R}$. I understand that for some values $x,y\in$ dom$f$ and $t\in[0,1]$ that the function is not convex. However, I am having trouble proving that this function has convex level sets. We can define the level set as, $$L_{c}(f):=\{x\in\mathbb{R}\mid f(x)\leq c\}.$$
I understand that for the level sets to be convex means that $\forall x,y\in$ dom$f$, and $\forall t\in[0,1]$, $f(tx+(1-t)y)\leq c$. But I do not know how to use the fact that $f(x)$ is not convex.
Based on the level sets for $f(x)$, we know that $-c^2\leq x\leq c^2$. And so if we find that $-c^2\leq tx+(1-t)y\leq c^2$, then the level sets are convex?

The level sets are the intervals $[-c^2,c^2]$, which are obviously convex sets. However, $f$ is not a convex function.
You have probably learned that if $f$ is convex, then its level sets are convex. his is an example that shows that the converse is not true in general.
