If $\overline A\cap B = A\cap \overline B = \varnothing$, $A\cup B$ is disconnected. I'm trying to show that if $\overline A\cap B = A\cap \overline B = \varnothing$, $A\cup B$ is disconnected. First of all, I think I have to assume that $A$ and $B$ are nonempty, or else the statement would not be true if I just let $A = \varnothing$ and let $B$ be a connected set.
I'm working in a metric space where the definition of a set $S$ being open is that $\forall x\in S$, $\exists \varepsilon > 0: B(x,\varepsilon)\subseteq S$, and the definition of a set $T$ being closed is that $T$ is the complement of an open set.
So assuming $A$ and $B$ are nonempty and $\overline A\cap B = A\cap \overline B = \varnothing$, to demonstrate that $S = A\cup B$ is disconnected I must find open sets $U_1$ and $U_2$ such that


*

*$U_1\cap U_2 = \varnothing$

*$S = (S\cap U_1) \cup (S\cap U_2)$

*$S\cap U_1\neq \varnothing$ and $S\cap U_2\neq \varnothing$.


At first I thought of taking $U_1 = (\overline A)^c$ and $U_2 = (\overline B)^c$, but I don't necessarily know that these are disjoint. My second thought was this: Let $x\in A$. Then since $x\in (\overline B)^c$ and this set is open, $\exists \varepsilon_x > 0: B(x,\varepsilon_x)\subseteq (\overline B)^c$. Then I wanted to define $U_1 = \cup_{x\in A} B(x,\varepsilon_x)$ so that $A\subseteq U_1 \subseteq (\overline B)^c$, and then similarly define $U_2$ so that $B\subseteq U_2\subseteq (\overline A)^c$. However, I still don't think this works, since $U_1$ and $U_2$ could just share a point that is neither in $A$ nor $B$, but is in $(\overline A)^c \cap (\overline B)^c$. Any suggestions?

First, note that a separation on a subspace of a topological space consists of two non-empty, disjoint sets that are open relative to the subspace. Here, you need two non-empty, disjoint sets that are open in $A \cup B $. It is an equivalent problem to prove the existence of two non-empty disjoint sets that are closed relative to $A \cup B$.  The sets $\overline{A} \cap (A \cup B)$ (which equals A) and $\overline{B} \cap (A \cup B)$ (which equals B) satisfy this second condition.
