Inequality $|f(x)− f(y)| ≤ |x−y|$ I wanna determine whether it is true that if  $|f(x)− f(y)| ≤ |x−y|$ for all real $x$ and $y$, then $f$ is a constant function. How can this be proved?
I know the solution for $|f(x)− f(y)| ≤ |x−y|^2$, then you simply divide by $(x-y)$ and take the limit, but what about this problem?
In addition, for which $p ∈ \Bbb R$ is it true that if $|f(x)− f(y)| ≤ |x−y|^p$ for all real x and y, then f is a constant function?
 A: There are lots of function $f$ which satisfy $|f(x)-f(y)|\leq|x-y|$ and are not constant. One example is the sine function:
$$|\sin(x)-\sin(y)|=|\cos(\xi)|\cdot|x-y|\leq|x-y|$$
for some $\xi$ between $x$ and $y$ by the mean value theorem. Functions like $\sin$ which satisfy $|f(x)-f(y)|\leq M|x-y|$ for some constant $M$ are known as Lipschitz-continuous functions.
Functions which satisfy the more general property $|f(x)-f(y)|\leq M|x-y|^\alpha$ are known as $\alpha$-Hölder continuous functions. Note that $\alpha=1$ corresponds to Lipschitz functions, so this is a generalization of the concept of Lipschitz continuity. All $\alpha$-Hölder continuous functions with $\alpha>1$ are constant by the same argument that you gave:
$$\lim_{x\to y}\left|\frac{f(x)-f(y)}{x-y}\right|\leq\lim_{x\to y}\frac{M|x-y|^\alpha}{|x-y|}=\lim_{x\to y}M|x-y|^{\alpha-1}=0,$$
so every $\alpha$-Hölder continuous function with $\alpha>1$ is differentiable and has $f'=0$ everywhere, and is hence constant.
A: To get a counterexample, simply consider the sine function. The inequality is satisfied by the Mean value inequality. Yet, is $\sin x$ constant?
Edit:
The condition means the function is $1$-Lipschitz. Another simple example of a non-constant $1$-Lipschitz function is the absolute value, since, by the triangle inequality ($2^\text{nd}$  form),
$$\bigl||x|-|y|\bigr|\le |x-y| .$$
A: Take $f(x)=\sin(x)$.
By MVT,
$$(\forall x,y\in\Bbb R)\;\;|f(x)-f(y)|=|(x-y)\cos(c)|$$
$$\le |x-y|$$
but $ f $, as i think, is not constant.
A: A trivial non-constant $f$ such that $|f(x) - f(y)| \leq |x - y|$ is $f(x) = x$.
In fact, consider $f(x) = x$ if $0 \leq x \leq 1$, $f(x) = 0$ if $x \leq 0$, and $f(x) = 1$ if $x \geq 1$. In this case, we see that for all $p \leq 1$, for all $x, y$, $|f(x) - f(y)| \leq |x - y|^p$.
Now suppose that $p > 1$. In this case, we see that for all $n$, we have $|f(0) - f(x)| = |f(0) - f(\frac{1}{n} x) + f(\frac{1}{n} x) - f(\frac{2}{n} x) + ... + f(\frac{(n - 1)}{n} x) - f(x)| \leq |f(0) - f(\frac{1}{n} x)| + |f(\frac{1}{n} x) - f(\frac{2}{n} x)| + ... + |f(\frac{(n - 1)}{n} x) - f(x)| \leq |0 - \frac{1}{n} x|^p + |\frac{1}{n} x - \frac{2}{n} x|^p + ... + |\frac{n - 1}{n}x - x| = n \cdot (\frac{1}{n})^p = \frac{1}{n^{p - 1}}$.
But since $p > 1$, we can make $n^{p - 1}$ arbitrarily large. Then $|f(0) - f(x)| = 0$. Then $f(0) = f(x)$. Then $f$ is constant.
