[Math] If two non-disjoint subsets are connected, why does their union have to be connected

connectednessgeneral-topology

So X and Y are two sets such that their intersection is nonempty. I want to show that if X and Y are each connected, together their union is connected.

I tried proving this by contraposition and I've thought about it for a while but can't come up with the conclusion.

I suppose that X union Y is not connected. This means that X union Y can be written as a union of two separated sets C and D (meaning no point of C is in the closure of D and vice versa). So C is contained in the intersection of X and Y because the two sets overlap at at least one point.
Here is where I'm stuck. From this information, how can I conclude that X can be written as a union of two separated sets?

Thanks in advance

Best Answer

What you need to do now is show that (at least) one of $X$ and $Y$ has nontrivial intersection with both $C$ and $D$. Suppose $X$ is the one. Use this to decompose $X$ into non-intersecting, non-empty open sets, contradicting the connectedness hypothesis.