Let $H$ be a real Hilbert space and $\bar{B_r} = \{x\in H :\Vert x\Vert \leq r\}$ with $r>0$. Define $f:H \rightarrow \bar {B_r}$ by
$ f(x)=\left\{ \begin{array} xx,& \Vert x \Vert \leq r\\ rx/\Vert x \Vert,& \Vert x \Vert >r \end{array}\right. $
I want to prove that f is a nonexpansive map(i.e. $\Vert f(x)-f(y) \Vert \leq \Vert x-y \Vert$).
First we need the following Hilbert space inequality:
To return to your question, there are three cases we need to examine, regarding where $x,y$ lie: If $x, y\in B(0,r)$, then the result is obvious. If $\|x\|, \|y\|>r$, then it follows from the previous lemma. If $\|x\|\leq r$ and $\|y\|>r$, then we need to show that $$\left\|\|x\|-\tfrac{ry}{\|y\|}\right\| \leq \|x-y\|.$$ I will leave the details of this case to you, just follow the steps of the proof of Lemma 1.