Solve for all possible functions f: $|f(x)-f(y)|=2|x-y|$. I'm getting $f(x)=2x+f(0)$ and $f(x)=f(0)-2x$ by setting $y=0$, but I'd like to verify. Am I right?
 A: The function $f$ is clearly continuous and one-to-one, since it satisfies the Lipschitz condition and $f(x) = f(y)$ implies $x=y$. Thus $f$ is monotone, and consequently either increasing or decreasing. 
If $f$ is increasing, the condition $|f(x) - f(0)| = 2|x|$ leads to $$x > 0 \implies f(x) > f(0) \implies f(x) - f(0) = 2x$$ and $$x < 0 \implies f(x) < f(0) \implies f(0) - f(x) = -2x$$
so that $f(x) = 2x + f(0)$ for all $x \in \mathbb R$.
Likewise, if $f$ is decreasing then $f(x) = -2x + f(0)$ for all $x \in \mathbb R$.
This means these are  the only two functions satisfying the stated condition.
A: Another way to look at it is perhaps that the condition is equivalent to
$$\left|\dfrac{f(x)-f(y)}{x-y}\right| = 2 \quad \quad \text{for } x \neq y$$
which says that absolute values of the slopes of the secant lines at any pair of points $x$ and $y$ are always 2. That is, the possible slopes of the secant lines at any pair of points $x$ and $y$ are $\pm 2$
A: For $y = 0$ we get that
$$
 f(x) = f(0) \pm 2x
$$
for all $x \in \Bbb R$. We want to show that the same sign must hold for all $x$, i.e. either
$$
f(x) = f(0) + 2x \quad \text{for all $x$}
$$
or
$$
f(x) = f(0) - 2x \quad \text{for all $x$.}
$$
So assume that
$$
 f(x_1) = f(0) + 2x_1 \\
 f(x_2) = f(0) - 2x_2 
$$
for non-zero $x_1, x_2$. Then 
$$
 2|x_1 - x_2| = |f(x_1) - f(x_2)| = 2 |x_1 + x_2| \\
\implies (x_1 - x_2) ^2 = (x_1 + x_2)^2 \\
\implies x_1 x_2 = 0
$$
is a contradiction.
