$\newcommand{\til}{\tilde}$
Let $(X,d)$ be a metric space, and let $S \subseteq X$. Suppose that every point in $X$ has a unique closest point in $S$, which we denote by $\tilde s(p)$.
Is it true that the map $\tilde s:X \to S$ is continuous?
I know that the answer is positive when $S$ is compact. What happens when it is non-compact?
Here is a proof for the compact case:
Let $d_S:X \to \mathbb R$ denote the distance function from $S$, i.e. $d_S(p):=\text{dist}(p,S) = \inf_{s \in S} d(p,s)$.
We will use the Urysohn property: Let $p_n \in X$ be a sequence which converges to $p$ in $X$. We want to prove that $\tilde s(p_n) \to \tilde s(p)$.
Let $p_{n_k}$ be a subsequence; Then $\til s\left( p_{n_k} \right) \in S$, hence by compactness of $S$ it has a convergent subsequence $s_l:=\tilde s\left( p_{n_{k_l}} \right)$ with limit $\til s \in S$. It suffices to prove that $\til s = \tilde s(p)$. Taking the limit $l \to \infty$ of both sides of the equality $$ d( p_{n_{k_l}} , s_l)= d ( p_{n_{k_l}},\til s(p_{n_{k_l}}) )= d_{S}( p_{n_{k_l}} ) $$ and using the facts that $d,d_S$ are continuous, and $p_{n_{k_l}} \to p,s_l \to\tilde s $, we obtain $$ d(p,\tilde s) = d_{S}(p), $$ which by the assumed uniqueness forces $\til s = \til s\left( p \right)$.
No. For instance, let $X=(0,1]\times\{1\}\cup[0,1]\times\{0\}\cup\{(0,-1)\}\subset\mathbb{R}^2$ with the Euclidean metric and $S=(0,1]\times\{1\}\cup\{(0,-1)\}$. Then $\tilde{s}(t,0)=(t,1)$ for $t\in(0,1]$ but $\tilde{s}(0,0)=(0,-1)$, so $\tilde{s}$ is discontinuous at $(0,0)$.