If $f$ is continuous on $[a,b]$ and every point of $[a,b]$ is a local maximum point, then $f$ is a constant function.
Solution 1:
The function $f$ is continuous on the compact $[a,b]$, so it achieves its global minimum at a point $m\in[a,b]$. Now $C:=\{x\in[a,b]: f(x)=f(m)\}$ is non-empty ($m\in C$), closed in $[a,b]$ (it is equal to $f^{-1}\langle\{f(m)\}\rangle$ and $f$ is continuous), and open in $[a,b]$ (because any $x\in C$ is a local maximum point, so $f(m)=f(x)\ge f(t)\ge f(m)$ for all $t$ sufficiently close to $x$). Since $[a,b]$ is a connected set, this proves that $C=[a,b]$.