$A$ and $B$ are connected spaces and $B$ has limit points of $A$ so $A \cup B$ is also connected I know that if $A \cap B $ is non empty then the union is connected, but how can I ensure that if the closure of $A$ and $B$ has commom points implies in $A \cap B $ is non empty?
 A: Suppose $A$ and $B$ are connected and $\overline{A}\cap B\neq\emptyset$. Suppose $f:A\cup B \to \{0,1\}$ is a continuous function, where the topology on $\{0,1\}$ is discrete.  Then $f|_{A}$ and $f|_{B}$ are continuous. Since $A$ and $B$ are connected $f|_{A}$ and $f|_{B}$ are constant. WLOG assume $f|_{A}\equiv 0$ and $f|_{B}\equiv 1$. Since $\overline A$ is closed and $f$ is continuous $f(\overline A)\subseteq\overline{f(A)}=\{0\}$. But as  $\overline{A}\cap B\neq\emptyset$, there exists $b\in B$ such that $b\in\overline A$. Therefore $f(b)=0$ which is a contradiction. Therefore $f$ is constant. Hence $A\cup B$ is connected.
A: We can even assume the weaker condition that $\overline{A} \cap B \neq \emptyset$ (or by symmetry $A \cap \overline{B} \neq \emptyset$, interchanging the rôles of $A$ and $B$).
To see that $A \cup B$ is connected, suppose there is a set $C \subseteq (A \cup B)$ that is non-empty closed and open (clopen) in $A \cup B$.
We want to show that $C = A \cup B$. We can assume WLOG it contains some $p \in A$ (or else we use its complement; if there is nothing in the complement we are done already).
So as $C \cap A$ is closed and open and non-empty in $A$, we know by connectedness of $A$, that $C \cap A = A$ or $A \subseteq C$. 
But then $\overline{A} \subseteq C$ as well, as $C$ is closed. 
If $q \in \overline{A} \cap B$ existed, then we'd know that $q \in B \cap C$ and thus $C \cap B \neq \emptyset$ is non-empty and clopen in $B$, ensuring that $C \cap B = B$ or $B \subseteq C$. But then $C \subseteq A \cup B \subseteq C$ and we are done. 
