let $\displaystyle (X,d)$ be a metric space and $\displaystyle A\neq \phi $ a subset of X then $\displaystyle x \in \overline{A}$ $\displaystyle iff $
$\displaystyle d(x,A)=0$
$\displaystyle (\Rightarrow )$
Suppose $\displaystyle x \in \overline{A}$ but $\displaystyle d(x,A)=\delta >0$. Then consider $\displaystyle B(x,\frac{\delta}{2})$this is an open neighborhood containing x, but does not intersect A, thus $\displaystyle x \not \in \overline{A}$, contradiction. d(x,A)=0 as desired.
$\displaystyle (\Leftarrow)$ Let d(x,A)=0. Suppose $\displaystyle x \not \in \overline{A}$ then there exists an open set U containing x, but does not intersect A. By definition of open set, this means there is a basis element (a ball) containing x and contained in U. That is $\displaystyle x \in B(x,\delta) \subset U \subset A^c$. But this means $\displaystyle d(x,A)>\delta >0$ contradiction. thus $\displaystyle x \in \overline{A}$ as desired.
QED