I am reading "Continuity" in Metric Spaces
Suppose $S\subset \mathbb R$ is a closed set. Suppose $A\subset \mathbb R$ has the property that for every $a\in A$ there is a unique nearest point $f(a)$ of $S$ to $a$. Show that $a\to f(a)$ from $A$ to $S$ is continuous.
Please give some hints on how to proceed. Please dont give complete solution