Prove for $x \in \mathbb{X}: x \in \bar{A} \Leftrightarrow d_A(x)=0$ For $A \subset \mathbb{X}$ non empty and $x \in \mathbb{X}$ define the distance of x to A by $$d_A(x)=inf_{a \in A} d(x,a)$$

I am trying to prove for $$x \in \mathbb{X}: x \in \bar{A} \Leftrightarrow d_A(x)=0$$

The proof starts of by saying if $x \in \bar{A}$ then there is some $y\in A$.

How can we say this? 

How do we know there is some $y \in A$?
As others noted, you explicitly assumed that $A\neq \emptyset$. 

Here is a relatively easy proof of the fact. We use a characterization of the closure of a subset $$\bar A = \{x\in X\,|\, \forall U\in\mathcal O_x: A\cap U\neq\emptyset\}$$ (this is just a restatement of the fact that $\bar A = A\cup A_0$ where $A_0$ is the set of limit points of $A$)

Now, for the proof itself:

\begin{align}
x\in \bar A &amp; \iff (\forall U\in\mathcal O_x)\ A\cap U\neq\emptyset\\
&amp; \iff (\forall\varepsilon&gt;0)\ A\cap K_d(x,\varepsilon)\neq\emptyset\\
&amp; \iff (\forall\varepsilon&gt;0)(\exists a\in A)\ d(x,a)&lt;\varepsilon \\
&amp; \iff \inf_{a\in A}d(x,a) = 0
\end{align}
The closure of any nonempty set cannot be nonempty. This is easily seen from the definition of the closure of $A\subseteq X$ as the intersection of all closed subsets in X where A is a subset of each set: This intersection cannot be empty unless A = $\emptyset$. 

As for the proof of the result, consider the metric as defined. Let $\bar A$= $\cap\mathbb F$ where $\mathbb F$= { $F\subset X$  | $F^c$ is open in X and $A\subset F$}. Let $x\in \bar A$. If $x\in A$, we're done. Let $x\notin A$. By definition, if a$\in A$, $d_A(x)=inf_{a \in A}$d(x,a).Since x$\in\bar A$ = $\cap^{\infty}_{i\in I}$ $F_i$, then  $d_A(x)$= min{$r_i\in\mathbb R &gt; 0|d_A(y)= r_i $ where $y\neq x\in F_i\in \mathbb F$}.Therefore $d_A(x) &lt; r^{*}_y$ = $inf_{a \in A}$ d(y,a) for every $y\in\bar A$. But since $r^{*}_y\in \mathbb R &gt; 0$ is arbitrary, we're forced to conclude  $d_A(x)= 0$. 

(Seem to have finally fixed the code myself. Never mind.Now I wish someone would tell me what's wrong with this corrected proof if anything.)