In a metric space $(X,d)$, prove that for each subset $A$, $x\in\bar A$ if and only if $d(x,A)=0$
I feel like this isn't necessarily true. For example, let $X$ equal the reals and $A$ be some open subset of $X$, let's say $(0,1)$. Then $0.5$ is an element of $\bar{A}$, but $d(x,A) = d(0.5,0) \neq 0$
This question seems simple enough; I don't know why it's giving me such trouble.