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 ??
 A: The set $B$  is NOT open, so this is not a partition of $\overline X$ in open sets.
A: 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.
A: I think that in your reasoning there is two incorrectness:


*

*We have $\overline{X}=X\cup B\cup\{(1,\sin(1))\}$.

*The implication : 
$X$ and $B$ are connected and $X\cap B=\emptyset$ $\Rightarrow$ $X\cup B$
is not connected 
is false. For a counterexample one can see that $\{0\}$ and $(0,1]$ are connected and disjoint, and $\{0\}\cup(0,1]=[0,1]$ is also connected.
A: I think that there is an error for $\overline{X}$. You have $\overline{X} = X \cup B$. "The curve is not oscillating on the right side"
