Then $f$ is constant (in particular, $f$ is differentiable).
To show this, consider $x\ne y$, split the interval between $x$ and $y$ into $n\geqslant1$ parts of length $|x-y|$ and apply the triangular inequality. This yields
Now, apply the hypothesis to each of these intervals. The result is
When $n\to\infty$, this proves that $f(x)=f(y)$.
Note that the same result holds as soon as $|f(x)-f(y)|\leqslant C|x-y|^a$ for every $x$ and $y$, for some $a\gt1$.