Little confusion about connectedness Consider $X=\{(x,\sin(1/x)):0<x<1\}$. Then clearly $X$ is connected , as it is a continuous image of the connected set $(0,1)$.
So, $\overline X$ is also connected , as closure of connected set is connected.
Now if we notice about the set $\overline X$ then 
$$\overline X=X\cup B$$
where , $B=\{(0,y):-1\le y\le 1\}$
Now , $X$ and $B$ both are connected , and $X\cap B=\emptyset$ . So, $\overline X$ is disconnected.
Where my mistake ??

In a comment you mentioned the following correct theorem:
Theorem: If $A$ and $B$ are connected and $A \cap B \neq \varnothing$ then $A \cup B$ is connected.
You might have confused this with the below converse, which is false:
False: If $A$ and $B$ are connected and $A \cap B = \varnothing$ then $A \cup B$ is not connected.
Counterexamples have been given in other answers, such as $A = (0;1]$ and $B=\{0\}$.
In order to make this statement true, you need $A$ and $B$ to be not only disjoint, but separated by disjoint open sets, i.e., that there exist open disjoint sets $X \supset A$ and $Y \supset B$.
You can also separate them by closed sets, which leads to the following correct theorem:
Theorem: If $A$ and $B$ are connected and non-empty, and $\overline{A} \cap \overline{B} = \varnothing$ then $A \cup B$ is not connected.
