Prove that $f$ is constant if and only if for all point pair $x,y \in \mathbb{R} $, $$ | f(x) - f(y) | \leq (x-y)^2 $$
My attempt:
It's a double implication so...
To right:
$f$ is constant $\Rightarrow \forall c \in \mathbb{R}, f(c) = k $, with $ k \in \mathbb{R} \Rightarrow \forall x,y \in \mathbb{R} , | f(x) - f(y) | = 0 \Rightarrow 0 \leq (x-y)^2 $
We observe that $(x-y)^2$ is the square of the difference of two real numbers, hence, is always positive.
To left:
We cant think $(x-y)^2$ as $|x-y|^2$, so:
$$ | f(x) - f(y) | \leq |x-y|^2$$ $$ \Bigg|\frac{f(x) - f(y)}{x-y}\Bigg| \leq |x-y| $$ $$ \lim_{x \to y}{\Bigg|\frac{f(x) - f(y)}{x-y}\Bigg|} \leq \lim_{x \to y}{|x-y|} $$ $$ |f'(y)| \leq 0 $$ We know that the module of a number is always greater or equal to $0$. So $ |f'(y)| = 0 $. $$ |f'(y)| = 0 \Rightarrow f(y) \ \text{is constant} $$
But I'm not sure if I can get into the absolute value with the limit. The statement doesn't mention that $f$ is differentiable.
You proof works, the fact that $f$ is not supposed being differentiable is normal. Indeed, you showed that $\left|\frac{f(x)-f(y)}{x-y}\right|\leqslant |x-y|$ for all $x\neq y$, since $\lim\limits_{x\rightarrow y}|x-y|=0$, we also have $\lim\limits_{x\rightarrow y}\frac{f(x)-f(y)}{x-y}=0$. By doing this, you proved that $f$ is differentiable at $y$ and $f'(y)=0$, since $y$ is arbitrary, this means that $f'=0$ and therefore $f$ is constant.