Let $(X,d)$ be a connected metric space(e.g. metrizable topological vector space, or $R^n$(with $n\ge 2$)) with metric $d$, $A$ is a closed subset of $X$ with the property that for each $x∈X$, there is a unique $y∈A$ with $d(x,y)=\min_{z∈A}d(x,z)$. This defines a function $f:X→A$ by mapping all $x∈X$ to $y∈A$ as above.
Is $f:X\to A$ continuous?
Some Remarks:
(1)Of course if $f$ is continuous, then $A$ is a retract of $X$.
A very general example is that every closed convex complete subset in any inner product space has this property by Hilbert projection theorem(and in this case $f$ is a projection(Lipschitz continuous with Lipschitz constant $1$)).But I tried but failed to find a non-convex closed $A$ with this property in even $R^2$, so in $R^2$, $A$ with such property must be convex?
(2)And from this post Show that $a\to f(a)$ from $A$ to $S$ is continuous., we can see this is true for $X=\mathbb{R}$.
(3)But this $f$ may be not continuous for $X$ being only a metric space in general by a previous post Mapping to unique nearest point. (After thinking for a while, I think this counter-example is somewhat related to the un-connectedness of $X$, so I am curious about what if $X$ is connected? ).