$x\in \partial A \iff d(x,A)=d(x,A^{c})=0 \iff x \in \partial A^{c}$ In  $\Bbb R$ with the usual metric $|\cdot |$ and $A\subset\Bbb R $, I have to show that if:
$$x\in \partial A \iff d(x,A)=d(x,A^{c})=0 \iff x \in \partial A^{c}$$
where $\partial A$ is the boundary set of $A$. My proof began when I suppose that $x\in \partial A$, so by definition for all $r>0$, $B_{r}(x)\cap A  \neq 0$ and $B_{r}(x)\cap A^{c} \neq 0$, then there exist $y \in A$ and $z \in A^{c}$ such that $|x-y|<r$ and $|x-z|<r$, so by definition:
$$d(x,A)=\inf\{|x-a| \mid a\in \Bbb R \} \text{ and } d(x,A^{c})=\inf\{|x-a| \mid a\notin \Bbb R \}.$$
Then $d(x,A)<r$ and $d(x,A^{c})<r$ and I conclude $d(x,A)=d(x,A^{c})=0$. I don't know how to prove when I suppose that $d(x,A)=d(x,A^{c})=0$. If I suppose that $x\in \partial A^{c}$, it's similar, but the problem is when I suppose that $d(x,A)=d(x,A^{c})=0$.
Edit: i was thinking if $d(x,A)=d(x,A^{c})=0$ then $x \in \overline A$ and $x \in \overline A^{c}$ and this is $x\in \partial A^{c}$ and $x\in \partial A$it's right?
 A: $d(x,A)=0$ implies that for any $r>0$ there exists $a \in A$ with $d(a,x) <r$. Thus $a \in B_r(x) \cap A$. Hence every ball $B_r(x)$ centered at $x$ intersects $A$. Similarly, $d(x,A^{c})=0$ implies that every ball $B_r(X)$ centered at $x$ intersects $A^{c}$. Hence $x \in \partial A$ and $x \in \partial A^{c}$
A: Suppose $x \in \partial A$. Let $r>0$ be arbitrary. Then there is some $a \in B(x,r) \cap A$ and also some $a' \in B(x,r) \cap A^\complement$. So $d(x,A) = \inf \{d(x,z): z \in A\} \le d(x,a) < r$ and as $r>0$ was arbitrary, and all distances are $\ge 0$ we conclude that $d(x,A)=0$ ($0$ is a lower bound for all these distances and there can be no larger one). In the exact same way we conclude $d(x,A^\complement)=0$ as well. By definition of $\partial A$ it's clear that $\partial A =\partial A^\complement$ (as $(A^\complement)^\complement= A$, so if all balls around $x$ intersect $A$ and its complement, the same holds for $A^\complement$ and its complement $A$).
If $d(x,A)= d(x,A^\complement)=0$ take any $r>0$ again. Then if $B(x,r) \cap A$ would be empty, for all $a \in A$, $d(x,a) \ge r$, so $r$ is a lower bound for $\{d(x,a): a \in A\}$ and so $r \le d(x,A)$ (as the inf is the largest such upperbound) and this contradicts $d(x,A)=0$. Similarly, $B(x,r) \cap A^\complement$ must be non-empty or else we get a contradiction with $d(x,A^\complement)=0$.
If you know  the lemma
$$\forall \emptyset \neq B \subseteq X: x \in \overline{B} \iff d(x,B)=0$$
and the fact $$\partial A = \overline{A} \cap \overline{A^\complement}$$
then it's immediate from those too:
$x \in \partial A$ iff $x \in \overline{A}$ and $x \in \overline{A^\complement}$ iff $d(x,A) = 0$ and $ d(x,A^\complement) = 0$ iff $d(x,A^\complement)=0$ and $d(x,(A^\complement)^\complement)=0$ iff $x \in \overline{A^\complement}$ and $x \in \overline{(A^\complement)^\complement}$ iff $x \in \partial A^\complement$.
