Define the distance of a point $a$ to a non-empty set $X\subset \mathbb{R}$ by $d(a,X)=\inf\{|x-a|; x \in X\}$.
Show that
1) $d(a,X)=0 \iff a\in \overline{X}$;
2) if $F\subset \mathbb{R}$ is closed, so for all $a\in\mathbb{R}$ exists $b\in F$ such that $d(a,F)=|b-a|$.
Attempt to prove (1):
1) Suppose that $d(a,X)=a$, so $|x-a|\leq0$ for all $x\in X$. Therefore, $x-a=0$, that implies $x=a$. Such that $x\in X, a\in X$
On the other hand, if $a\in \overline{X}$, $a\in X$ or $a\in X'$.
If $a\in X$, $d(a,X)=|a-a|=0$.
if $a\in X'$, so for all $\epsilon>0$ exists $x\in X$ such that $0<|x-a|<\epsilon$.
Question:
$0<|x-a|<\epsilon\ \ \forall\ \epsilon>0 \implies \inf\{|x-a|; x\in X\}=0?$
2) Some hint?
For $2)$:
Suppose $F$ is closed and non-empty, and let $a \in \mathbb R$. Since $$d (a,F) = \inf_{x \in F} \{ |x - a| \}, $$
we can construct a sequence $\{ x_n \}$ such that $x_n \in F$ for all $n$ satisfying
$$ \lim_{n \to \infty} | x_n - a | = d(a,F). $$
However, since $\{ x_n \} \subset F$, and $F$ is closed, we must have that, passing to a subsequence if necessary(*), $\lim_{n \to \infty} x_n = x \in F$. Hence, $$|x-a|=d(a,F).$$
(*) As pointed out in the comments, $\{x_n\}$ may not converge. However, since $d(a,F)$ is finite (since $F$ is non-empty), $\{x_n\}$ is bounded, and thus must have a convergent subsequence by Bolzano-Weierstrass.