Let $(X,d)$ be a metric space and $S \subset X$. Show that $d_S(x):=\text{inf}\{d(x,s): s \in S\}=0 \Leftrightarrow x \in \overline S .$
Notes: $\overline S$ is the closure of S. Maybe you can use that a closed set is also closed for sequences in the set? I think the difficult part is when S is open, otherwise its trivial as the closure would be equal to S.