Union of connected subsets A and B is connected if $\bar{A} \cap B \neq \varnothing$ I was trying to prove this by using the property of the union of two connected sets with non-empty intersection but I wasn't able. I also proved that $\bar{A} \cup \bar{B}$ is connected but I dont know what to do now.
 A: Let $f: A \cup B \to \{0,1\}$ be continuous, where $\{0,1\}$ has the discrete topology. As $f\restriction_A \equiv i_A $ for some $i_A \in \{0,1\}$ by connectedness of $A$, and likewise for some $i_B \in \{0,1\}$ we have $f\restriction_B \equiv i_B $.
Now use continuity: $f[\overline{A}]\subseteq \overline{f[A]}=\{i_A\}$ as we have a discrete codomain. But then if $p \in \overline{A} \cap B$:
$$f(p) \in f[\overline{A}], \text{ so } f(p)=i_A \text{ and also } p \in f[B]=\{i_B\}, \text{ so } f(p)=i_B$$
and so $i_A=i_B$ and $f$ is constant. This shows that $A \cup B$ is connected.
A: I would try this way: We have $A,B$ connected subspaces of a space $X$, we need to prove that whenever we find two disjoint opens $U,V$ such that $A\cup B\subseteq U\cup V$, then either $A\cup B\subseteq U$ or $A\cup B\subseteq V$.
Now, $A\subseteq A\cup B\subseteq U\cup V$, and same for $B$, so since both are connected by hypothesis, we have four possibilities

*

*$A,B\subseteq U$, then $A\cup B\subseteq U$ and the conclusion is proved in this case


*$A,B\subseteq V$, same as 1)


*$A\subseteq U\wedge B\subseteq V$, here is where the hypothesis $\bar{A}\cap B\neq\emptyset$ is used, because since $U,V$ are disjoint $A\subseteq U\rightarrow A\cap V=\emptyset\rightarrow A\subseteq X-V$, but $X-V$ is closed, so $\bar{A}\subseteq X-V$ and $B\subseteq V$, which contradicts $\bar{A}\cap B\neq\emptyset$.


*$A\subseteq V\wedge B\subseteq U$, same as 3).
So case 3) and 4) cannot be, since they contradict the hypothesis, so either $A\cup B\subseteq U$ (first case), or $A\cup B\subseteq V$ (second case), thus proving our thesis.
Correction. $U,V$ need not be disjoint in $X$, but they must be disjoint in $A\cup B$. The proof of points 1,2 remains the same and so does point 3: $A\subseteq U$ implies that $A\cap V=\emptyset$ (otherwise there would be $x\in A\cap V\rightarrow x\in A\cup B$ and $x\in U\cap V$), so $\overline{A}\subseteq X-V$.....
