Proving $f(x)=\pm x + c$ Using Differentiation Suppose $|f(x)-f(y)|=|x-y|$ for all $x,y \in R$. Prove there is a constant $c$ such that $f(x)=\pm x+c$. Suppose $|f(x)-f(y)|=|x-y|$ for all $x,y \in R$. Prove there is a constant $c$ such that $f(x)=\pm x+c$. What I did was make $|\frac{f(x)-f(y)}{x-y}|=1$. Thus, $f$ is differentiable for all $x,y \in R$, and that $\forall x \in R, f'(x)=1$. Thus, $f(x)=x+c$. But where would the $-x$ be? I was considering a case where the denominator is a different sign than the numerator, but the absolute value bars stop me dead in my tracks. Another thing I considered doing was distributing the absolute value. I would get $f(x)=x+(f(y)-y)$ and $f(x)=-x+(f(y)+y)$. Then could I make y a constant, differentiate $f(x)$, and get my results?

You cannot conclude from $\left|\frac{f(x)-f(y)}{x-y}\right|=1$ that  $\lim_{y\to x}\frac{f(x)-f(y)}{x-y}=1$. In fact, even the existence of the limit is not that obvious.
You can solve the problem without differentiation for example by considering $f(0),f(1), f(x)$.
