Separated Sets are Clopen in Union

Theorem
Let $X$ be a topological space,

let $A$ and $B$ be separated sets in $X$, and

let $S=A \cup B$ be given the subspace topology.

Then $A$ and $B$ are each open and closed in $S$.

Proof
By hypothesis, $A$ and $B$ are separated, so
 * $\displaystyle A \cap B^- = A^- \cap B = \varnothing$.

Then

Since the intersection of a closed set with a subspace is closed in the subspace, $B$ is closed in $S$.

Since $A = S \setminus B$ and $B$ is closed in $S$, $A$ is open in $S$.

By the same argument with the roles of $A$ and $B$ reversed, $A$ is closed in $S$ and $B$ is open in $S$.