I am reading Zorich's book "Analysis I" and ran into the following statement:
Let $f:[a,b]\to \mathbb{R}$ and $f$ is continuous on $[a,b]$. Then $f$ is injective if and only if $f$ is strictly monotonic.
Proof: $\Leftarrow$ is quite obvious.
The most interesting part is $\Rightarrow$. Suppose that $f$ is not strictly monotonic. Then we can find three points $x_1<x_2<x_3$ from $[a,b]$ such that $f(x_2)$ does not lie in between $f(x_1)$ and $f(x_3)$. In this case $f(x_3)$ lies in between $f(x_1)$ and $f(x_2)$ or $f(x_1)$ lies in between $f(x_2)$ and $f(x_3)$.
Question: Suppose $f$ is not strictly monotonic, i.e. $f$ is not strictly increasing and is not strictly decreasing. Then we can find points $x_1,x_2,x_3,x_4\in [a,b]$ such that $x_1<x_2$ with $f(x_1)\geq f(x_2)$ and $x_3<x_4$ with $f(x_3)\leq f(x_4)$.
I have spent smth like couple of hours trying to derive that exists three points with the above properties as in Zorich's book but I failed.
I'd be thankful if you can help me, please!