Monotonicity with Euclidean distance We have a curve $y=f(x)>0$ and a moving point along the $x$ axis. For every position of the point, we find the nearest point on the curve, let $(x',f(x'))$, in the sense of the Euclidean distance.
Can we show that $x'$ is a monotonic (possibly discontinuous) function of $x$ ?

 A: Picture:

$X=(x',f(x'))$ is the closest point to $x$. $y$ is a point to the right of $x$. 
Where can $Y$, the closest point to $y$ lie?


*

*It must be outside (or on) the circle through $X$ centred at $x$ (dark brown), or $X$ would not be the closest point to $x$.

*It must be inside (or on) the circle through $X$ centred at $y$ (red), or it wouldn't be closer to $y$ than $X$ is.


But the only region where these are both true is the lune on the right (including its boundary). In particular, none of this possible region lies on the left of the green line, so $Y$ cannot be to the left of $X$. Hence the function is monotonic, for this positioning.
This works for any position of the two points provided $y>x$, since the circles will always be the same way round, and only intersect on the green line.
A: Here's a purely algebraic solution:
Let $h(x, a) = (x-a)^2 + f(x)^2$ so $\displaystyle a' = \mathop{\operatorname{argmin}}_{x \in \mathbb{R}} h(x, a)$. Let $a_1 < a_2$. Note that
$$h(x, a_2) - h(x, a_1) = (a_2-x)^2 - (a_1-x)^2 = (a_2-a_1)(a_2+a_1-2x).$$
This is a decreasing function of $x$. Now suppose for contradiction that $a_2' = x_1 < x_2 = a_1'$. Then
$$\begin{array}{lcl}
x_2 = a_1' & \implies & \phantom{ h(x_2, a_2) \: - } \: h(x_2, a_1) \leqslant \phantom{h(x_1, a_2) \: - } \: h(x_1, a_1) \\
x_1 < x_2 & \implies & h(x_2, a_2) - h(x_2, a_1) < h(x_1, a_2) - h(x_1, a_1) \\ \hline
& & h(x_2, a_2) \: \phantom{ - \: h(x_2, a_1) } < h(x_1, a_2)
\end{array}$$
So $x_1 \neq \mathop{\operatorname{argmin}}_{x \in \mathbb{R}} h(x, a_2)$, contradiction.

This solution has a nice illustration if $f(x)$ is smooth. For a fixed $a$ the point $a'$ will be $x$ such that $h(x, a)$ is minimal. If you fix $x_1 < x_2$ and move $a$ continuously to the right, you'll note that $h(x_1, a)$ and $h(x_2, a)$ are moving up or down, but $h(x_2, a)$ is always moving faster down (or slower up) than $h(x_1, a)$, since
$$\frac{\mathrm{d}}{\mathrm{d} a} h(x_2, a) = 2(a-x_2) < 2(a-x_1) = \frac{\mathrm{d}}{\mathrm{d} a} h(x_1, a).$$
So if $x_2$ minimizes $h(x, a_1)$, and we move from $a_1$ to a point $a_2$ to the right, $x_2$ can never be worse than any point $x_1 < x_2$, because it started better and was moving better.
A: Partial answer. To show that $x'$ may be definable but not  uniquely definable and may be monotonic but discontinuous, when $f$ is continuous. 
Let $f(x)=\sqrt {1-x^2}\;$ for $x\in [-1,1]$ and let $f(x+2)=f(x)$ for all $x\in \mathbb R.$ 
If $x\in \mathbb R$ \ $\mathbb Z$ or if $x$ is an odd integer then the unique nearest $(u,f(u))$ to $(x,0)$ is  $(x',f(x'))$ where $x'$ is the  $nearest$   integer to $x.$ (If $x$ is an odd integer then $(x,0)=(x,f(x))$ and $x'=x.$). 
If $x$ is an even integer  we may choose $x'$ to be any member of $[x-1,x+1]$ as all points of $\{(u,f(u): |u-x|\leq 1\}$ lie on the semi-circle of radius $1$ centered at $(x,0).$ 
Then $x'$ is defined and monotonic but cannot be  continuous  because if $x$ is an even integer then $\{z':z\in [x-1,x)\}=\{x-1\}$ and $\{z':z\in (x,x+1]\}=\{x+1\}.$
