Let $f(x) = |x|$ for $x \in [-1,1]$ and extend $f$ to all of $\mathbb R$ by requiring $f(x+2)=f(x)$. Prove that $|f(x)-f(y)|\le|x-y|$ for all $x$ and $y$.
This is easy to observe on a graph but my proof is long and a bit tedious. Just curious if there is a quick/elegant way?
Here is a reasonably quick way based on the observation that $f(x) = \min_{n \in \mathbb{Z}} |x-2n|$.
We have $|x-2n| \le |y-2n| +|x-y|$ for all $n$, and so $f(x) \le |y-2n| +|x-y|$ for all $n$. Now choose $n$ such that $f(y) = |y-2n|$, then we have $f(x)-f(y) \le |x-y|$. Swapping the roles of $x,y$ yields the desired result.