# Show that the function $f: X \to \Bbb R$ given by $f(x) = d(x, A)$ is a continuous function.

• Continuity of the function $x\mapsto d(x,A)$ on a metric space

• Continuity of $d(x,A)$
#### Solutions Collecting From Web of "Show that the function $f: X \to \Bbb R$ given by $f(x) = d(x, A)$ is a continuous function."
Fix $a\in A$. Since $d(x,a)\leq d(x,y)+d(y,a)$, taking $\inf\limits_{a\in A}$ we have that $$d(x,A)\leq d(x,y)+d(y,A)$$
By symmetry (i.e. $d(y,x)=d(x,y)$) $$d(y,A)\leq d(x,y)+d(x,A)$$ which gives that $$|f(x)-f(y)|\leq d(x,y)$$
Thus $f$ is $1-$Lipschitz continuous, whence it is continuous.$\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\blacktriangle$