Quoting from Boyd and Vanderberghe Convex Optimization-
For a function on R, quasiconvexity requires that each sublevel set be an interval (including, possibly, an infinite interval). An example of a quasiconvex function on R is shown in figure 3.9.
Figure 3.9 A quasiconvex function on R. For each α, the α-sublevel set Sα is convex, i.e., an interval. The sublevel set Sα is the interval [a, b]. The sublevel set Sβ is the interval (−∞, c].
I have a doubt in this. What exactly is meant by the fact that every sublevel set is an interval? I didnt really understand this explanation of quasiconvex functions and how to use this to test it.
Here is an example. Take $f(x) = \log(x)$ on the domain $x > 0$. Every sublevel set $S_\alpha$ of this function is:
$$ S_\alpha = \{ x > 0 : \log(x) \leq \alpha \} = \{ x > 0 : x \leq e^{\alpha} \} = (0, e^{\alpha}] $$
So in this case, the sublevel sets are indeed intervals, and $\log(x)$ is quasiconvex on $x > 0$.
Now, take for example $f(x) = x^3 + 3x^2$. Taking $\alpha = 2$ we have
$$ S_2 = \{ x : x^3 + 3x^2 \leq 2 \} = [-1, \sqrt{3}-1] \cup (-\infty, -\sqrt{3}-1] $$ which is clearly not an interval (see the picture below). Thus, the function is not quasiconvex, since it has at least one sublevel set which is not an interval.