I'm having some trouble solving the following exercise:
Let $A$ and $B$ be connected subspaces of a topological space $(X,\tau)$. If $A\cap B \neq \emptyset$, prove that the subspace $A\cup B$ is connected.
I was trying to do a proof by contradiction. I assumed that : $\exists D,F \in \tau_{A\cup B}: D\cap F = \emptyset \wedge D\cup F = A \cup B$.
Because $D,F \in \tau_{A\cup B }$, then $\exists D',F'\in \tau: D = D' \cap (A\cup B) \wedge F=F' \cap (A\cup B)$, But I don't know how to proceed from now on. How can I proceed with my proof?