Firstly, regarding your question, I don't see why we have
$$\bar{E} = E \cup E'' = A \cup B \implies E'' \subset A \text{ or } E'' \subset B.$$
This assertion need not be true without the connectedness of $E$, let's consider this case in $\mathbb{R}$:
$$\bar{E} = [0,1] \cup [2,3], \; E = (0,1) \cup (2,3), \; E'' = \{0, 1, 2, 3\}.$$
$\bar{E}$ is not connected, which satisfies our hypothesis. Now take $A = [0,1]$ and $B = [2,3]$ as subsets of $\bar{E}$.
$A$ and $B$ are nonempty, with $\bar{A} = [0,1]$, $\bar{B} = [2,3]$ and $\bar{A} \cap B = \bar{B} \cap A = \emptyset$. Thus, $A$ and $B$ are separated sets while $E'' \not\subset A$ and $E'' \not\subset B$. So, the simple fact that $\bar{E}$ is not connected (without knowing that $E$ is connected) cannot imply that
$$\bar{E} = A \cup B \implies E'' \subset A \text{ or } E'' \subset B.$$
I think there is also an issue with Babai's answer, which is
$$A \cap B \cap \bar{E} = \emptyset \implies (x \in \bar{E} \text{ and } x \in A \implies x \notin B, \; x \in \bar{E} \text{ and } x \in B \implies x \notin A).$$
I don't think this has any meaning (since $ A \cap B = \emptyset $, there is no need for $ \bar{E} $). Moreover, this does not imply that $ E'' \subset A $ or $ E'' \subset B $, because it’s possible to have limit points in both $ A $ and $ B $. If this is not the case, it must be proven.
I will present my method in the following paragraphs, hoping that someone will correct me if there is anything wrong.
My method involves proving that
$$
\bar{E} \text{ is not connected } \implies E \text{ is not connected.}
$$
If $\bar{E}$ is not connected, then
$$
\exists C,D \subset \bar{E}, C \ne \emptyset, D \ne \emptyset, \text{ such that }
\\ C \cup D = \bar{E} = E \cup E'' \land C \cap \bar{D} = D \cap \bar{C} = \emptyset.
\\(E'' = E' \setminus E, E' \text{ as the set of limit points of } E)
$$
Since $E'' = E' \setminus E$, we have $E \cap E'' = \emptyset$. Therefore,
$$
C \cup D = \bar{E} = E \cup E'' \implies \left( C \setminus E'' \right) \cup \left( D \setminus E'' \right) = E.
$$
Let $M = C \setminus E''$ and $N = D \setminus E''$, then $M \cup N = E$.
In order to prove that $E$ is not connected, it suffices to show that $M$ and $N$ are nonempty, separated sets.
We begin by proving that $M$ and $N$ are nonempty. That is, to prove
$$
E \cap M \ne \emptyset \land E \cap N \ne \emptyset.
$$
Without loss of generality, suppose that $E \cap M = E \cap \left( C \setminus E'' \right) = \emptyset$. Then
$$
E \cap M = E \cap \left( C \setminus E'' \right) = \emptyset \quad \left( \text{and } \because E \cap E'' = \emptyset \right) \implies E \cap C = \emptyset,
$$
and since
$
C \cup D = \bar{E} = E \cup E'',
$
we have
$$
E \subset D \implies E'' \cap C = \emptyset \quad \left( \text{for otherwise } C \cap \bar{D} \ne \emptyset \right).
$$
Thus, with $E \cap C = \emptyset$ previously obtained,
$$
E'' \cap C = E \cap C = \emptyset \quad \left( \text{whereas } C \subset \bar{E} = E'' \cup E \right) \implies C = \emptyset,
$$
which contradicts the condition given by the hypothesis, i.e., $C$ and $D$ are nonempty.
So, neither $M$ nor $N$ is empty.
It remains to be proven that $M$ and $N$ are separated, and it will be done.
Since $M = C \setminus E''$ and $N = D \setminus E''$, we have $M \cap N = \emptyset$.
we have $ C \cap \bar{D} = \emptyset$, so
$$
\forall x,\quad x\in M \implies x \in C \setminus E'' \subset C \quad \implies x \notin \bar{D} \implies x \notin \bar{D} \setminus E'' \implies x \notin \bar{N}.
$$
Thus, $M \cap \bar{N} = \emptyset $. And similarly, we can obtain $\bar{N} \cap M = \emptyset. $
Therefore, $M$ and $N$ are nonempty separated sets, and since $M \cup N = E$, il follows that $E$ is not connected. $\quad \square$