Continuously avoiding closed balls in a proper metric space Let $(X,d)$ be a proper metric space (closed balls are compact), and $r :[0, \infty) \rightarrow X$ be a continuous and proper (inverse image of compact is compact) map, with $r(0) = x_0$. Therefore, given a radius $R$, there exists $N_R > 0$ such that $r([N_R, \infty))$ avoids the closed ball $\overline{B}(x_0 ; R)$. Can the choice $R \mapsto N_R$ be made continuous in $R$? My last question came out of a very naive (and unsuccessful) attempt of doing so.
 A: Yes. Start with the function $f:(0, \infty) \to (0,\infty)$ defined by 
$$
f(R) = 1 + \inf\{t : r([t, \infty))\cap \overline{B}(x_0, R) = \varnothing \}
$$
This function may be discontinuous, but it is nondecreasing. For any such function there exists a continuous function $g:(0, \infty) \to (0,\infty)$ such that $g(R)\ge f(R)$ for all $R$.  (One may say that $f$ has a continuous majorant.) 
Proof: First put a staircase on top of $f$, for example 
$h(x) = f(\lceil n\rceil)$ does the job (it's a piecewise constant function). Then roll a carpet over the staircase, producing a piecewise linear function majorizing $h$. Putting this together in a formula, 
$$
g(n+\alpha) = (1-\alpha)f(n+1) +\alpha  f(n+2),\quad n\in\mathbb Z, \quad \alpha\in [0, 1)
$$
The fact that $g\ge f$ follows from 
$$
 (1-\alpha) f(n+1) + \alpha f(n+2) 
\ge (1-\alpha) f(n+\alpha) + \alpha f(n+\alpha) = f(n+\alpha)$$
The continuity follows from $g$ being linear on each segment $[n, n+1)$ and being continuous at the endpoints: $g(n) = f(n+1)$ for all integers $n$.
