Suppose that $f:\mathbb{R} \rightarrow \mathbb{R}$ is a continuous function. Prove that there exist intervals $I_1$ and $I_2$ such that
$\sup_{x \in I_{1}}f(x) \leq \inf_{x \in I_{2}}f(x)$
Now, we can consider any two intervals [a,b] and [c,d] so that $b \leq c$. Since f is continuous, we have that $\sup f(x)$ exists on [a,b] and similarly $\inf f(x)$ on [c,d]. If we get the above inequality then we are done. Otherwise, I tried to use the properties of sup and inf to get the inequality but the direction flips. I do not how to proceed further. Any hint would be appreciated.