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.
Hint: If $f$ is a constant on $[0,1]$ there is nothing to prove. Otherwise, there is point $c$ where $f$ attains its minimum on $[0,1]$ and a point $d$ where $f$ attains its maximum on $[0,1]$. Note that $f(c)<f(d)$. Consider a small interval $I_1$ around $c$ and a small interval $I_2$ around $d$.