(1) Let $(X,d)$ be a metric space, and let A be a non-empty subset. Show that the function $$D_A :X \to [0,\infty ]$$ defined by $$D_A (x) =\inf \{d(x,y) : y \in A\}$$ is $1$-Lipschitz (when $[0,\infty)$ is given the standard metric.
(2) Now suppose that A is compact. Prove that, for each $x \in X$, there is some $a \in A$, such that $D_A (x) = d(a,x)$.
This is part of a review sheet for an exam I am taking, not graded just some practice problems. I am having trouble with this question. I am not sure how to show something is Lipschitz. Do I want to show that $$d_{[0,\infty)} (D_A(x),D_A(x')) \le d_x(x,x')$$for all $x,x' \in X$? I am not entirely sure how to go about this.
For the second part, will I have to use something about A being a compact subset of a metric space implies A closed and bounded?
Hints: For $D_A$ to be $1$-Lipschitz (also known as a non-expanding function) you need to show that $d(D_A(x),D_A(x'))\le d(x,x')$. Here the first $d$ is the distance function in $[0,\infty]$, which is taken to be the usual Euclidean distance (with proper conventions regarding $\infty $). The second $d$ refers to the distance function of the metric space $X$. That is, for given $x,x'\in X$, you need to show that $|\inf \{d(x,y)\mid y\in A\}-\inf \{d(x',y)\mid y\in A\}|\le d(x,x')$. To prove this you'll need to use the triangle inequality at some point.
For part 2, use the fact that any sequence in $A$ has a convergent subsequence. Construct a suitable sequence that is trying to converge to the inf. Then take a convergent subsequence of it.