The closure of a connected set in a topological space is connected
Suppose that $E$ is connected. Let $A,B\subseteq X$ be separated sets (that is, $\overline{A}\cap B=A\cap\overline{B}=\varnothing$) such that $\overline{E}=A\cup B$, and suppose that $A\neq\varnothing$. Let us prove that $B=\varnothing$.
Let $a\in A$. Since $A\cap \overline{B}=\varnothing$, there exists a neighborhood $U$ of $a$ such that $U\cap B=\varnothing$. Since $a\in\overline{E}$, then there exists some point $x\in E\cap U$, so $x\not\in B$, hence $x\in E\cap A$. Therefore, $E\cap A\neq\varnothing$.
Notice that $E=(A\cap E)\cup (B\cap E)$, and $A\cap E$ and $B\cap E$ are obviously separated. As $A\cap E\neq\varnothing$, from the previous paragraph, and $E$ is connected, then $B\cap E=\varnothing$.
(See PS below for an alternative end to the proof without the argument by contradiction)
Finally, suppose, in order to obtain a contradiction, that $B\neq\varnothing$, and take $b\in B$. By the same arguments as those used in the second paragraph above, switching $A$ and $B$ and $a$ by $b$, we would conclude that $B\cap E\neq\varnothing$, contradicting what we have just proved.
Therefore, $B=\varnothing$. This proves that $\overline{E}$ is connected.
PS: As $E\subseteq A\cup B$ and $E\cap B=\varnothing$, then $E\subseteq A$, so $\overline{E}\subseteq\overline{A}$. It follows that $$B=B\cap\overline{E}\subseteq B\cap\overline{A}=\varnothing.$$
I believe this can be made even more concise: Suppose $\overline{E}=A\cup B$ for disjoint, nonempty, and open $A,B$.
$E$ connected and $E=(A\cap E)\cup (B\cap E)$, so wlog, $A\cap E=E$. Then $B$ is an open set containing a limit point of $E$, and so it must intersect $E\subseteq A$ nontrivially - contradiction, as $A\cap B=\emptyset$.
There is only one part which might not have been explained in detail **
$ E''\subset A$ or $E''\subset B$
**
$A$ and B are separation of $\bar{E}$ implies $A\cap E$ and $B\cap E$ is a separation of $E$(trivial to proof).
$\implies$ $\overline{(A\cap E)}\cap(B\cap E)=\emptyset$ $\implies (\bar{A}\cap\bar{E})\cap B \cap E=\emptyset (\because \bar{X}\cap \bar{Y}\subset \overline{X\cap Y} )\implies \bar{A}\cap B \cap \bar{E}=\emptyset \implies A\cap B\cap\bar{ E}=\emptyset$
(I kept using the fact: $C\cap D=\emptyset $ and $C'\subset C$ then $C'\cap D=\emptyset$)
$A\cap B\cap \bar{E}=\emptyset$ says if $x\in \bar{E}$ and also $x\in A$ then $x\not\in B$ (Similarly, $x\in \bar{E}$ and also $x\in B$ then $x\not\in A$.
Therefore, $E''\subset A$ or $E''\subset B$
It is important to keep using the equivalent definitions of connectedness:
A topological space $X$ is disconnected if
Definition 1: there are two non-empty open sets $A$ and $B$ such that $X=A\cup B$ and $A\cap B=\emptyset$
Definition 2: there are two subsets $A$ and $B$ such that $X=A\cup B,$ $\bar{A}\cap B=\emptyset$ and $A\cap \bar{B}=\emptyset$