TITLE: Continuous function on closed unit ball
QUESTION [9 upvotes]: Take a continuous mapping $f: \bar{B^{n}} \rightarrow \bar{B^{n}}$, where $\bar{B^{n}}$ is a closed unit ball in $\mathbb{R}^{n}$. Assume that $f(x) \neq x$ for every $x \in \bar{B^{n}}$. Define another function $r$ by following the directed line segment from $f(x)$ through $x$ to its intersection with $\partial B^{n}$, and let the intersection point be $r(x)$. Is it immediately evident that $r$ is a continuous function? Is so how does it follow? Thanks.

REPLY [12 votes]: Since translations are continuous, we may assume that $B^n$ is the unit ball centred at the origin. Then 
$$
r(x)=f(x)+\lambda_x\,(x-f(x)),
$$
with $\lambda_x\geq0$ such that 
$$
\|f(x)+\lambda_x\,(x-f(x))\|=1.
$$
This equality can be written as $\|f(x)+\lambda_x\,(x-f(x))\|^2=1$, and it expands to
$$
\|x-f(x)\|^2\,\lambda_x^2+2\langle f(x),x-f(x)\rangle\,\lambda_x+\|f(x)\|^2-1=0.
$$
This is quadratic in $\lambda_x$, and we want the non-negative solution, which is 
$$
\lambda_x=\frac{-\langle f(x),x-f(x)\rangle+\sqrt{\langle f(x),x-f(x)\rangle^2-\|x-f(x)\|^2(\|f(x)\|^2-1)}}{\|x-f(x)\|^2}.
$$
The term inside the square root is always non-negative and bigger than $\langle f(x),x-f(x)\rangle^2$, so $\lambda_x\geq0$. 
It is clear that $\lambda_x$ depends continuously on $x$, and so $r(x)$ is continuous.