I am trying to prove the following:
Let $X$ be a Banach space and $B_r$ the closed ball in $X$ centered at $0$ and of radius $r$.
Then the map $f:X\to B_r$ defined by \begin{equation} f(x) = \left. \begin{cases} x, & |x|\leq r\\ r\frac{x}{|x|}, & |x|\geq r \end{cases} \right. \end{equation} is Lipschitz-continuous with constant $2$.
My work:
If $x,y\in B_r$, then $|f(x)-f(y)|=|x-y|\leq 2|x-y|$.
If $|x|,|y|\geq r$, then $|f(x)-f(y)|=r|\frac{x}{|x|}-\frac{y}{|y|}|=\frac{r}{|x|}|x-\frac{|x|}{|y|}y|\leq (|x-y|+|y-\frac{|x|}{|y|}y|)\leq 2|x-y|$.
Now, I'm having difficulties to prove the remaining case:
$|f(x)-f(y)|=|x-r\frac{y}{|y|}|\leq 2|x-y|$, for $x\leq r$ and $y\geq r$.
Any help is welcome. Thanks in advance.