(Baby Rudin Chapter 5 Exercise 1)
Let $f$ be defined for all real $x$, and suppose that \begin{equation}\tag{1} |f(x)-f(y)|\le (x-y)^2 \end{equation} Prove that $f$ is constant.
My attempt:
Let $f$ be defined for all real-valued inputs. Let $x \in \mathbb{R}$ and $y \in \mathbb{R} \smallsetminus \{ x \}$, and suppose that (1) holds. Then, we have: \begin{align*} \left| \dfrac{f(x)-f(y)}{x-y}\right| \le (x-y) \end{align*} As $x\to y, \lim\limits_{x \to y}\left| \dfrac{f(x)-f(y)}{x-y}\right| \le 0$. Since it cannot be that $\left|f'(y)\right| < 0$, we have that $\left|f'(y)\right| = 0 \implies f'(y) = 0$.
Can someone please read over my proof and let me know if it is correct?
Your deduction that $$\frac{|f(x)-f(y)|}{|x-y|}\le x-y$$ is incorrect because it would lead to $$|f(x)-f(y)|\le |x-y|\cdot(x-y)\ne (x-y)^2$$ To make it work, you may want to deduce that $$\frac{|f(x)-f(y)|}{|x-y|}\le |x-y|$$
Your solution is otherwise correct.