Prove that if $f$ is a function on an interval $[a,b]$ satisfying $$|f(x_1)-f(x_2)|\leqslant(x_1-x_2)^2 \ \text{ for all } \ x_1,x_2\in[a,b],$$ then $f$ is constant on $[a,b]$.
For any $x\in(a,b)$, we have $|f(x+h)-f(x)|/|h|\leqslant h^2/|h|=|h|$. So, from the Sandwich Theorem, we get $f^\prime(x)=0$. Similarly, the given condition implies that $f$ is right continuous at $a$ and left continuous at $b$, so by Theorem 2.5, $f$ is constant on $[a,b]$.
Doesn't this question need the condition that $f$ is differentiable on $(a,b)$?