This question might have been answered before but I need different proof using the following fact:
Suppose $C$ is a connected set in a metric space (M,d). Let $A$ and $B$ be two separated sets in $(M,d)$, i.e., $A \cap \bar{B} = \emptyset = A \cap \bar{B} $ such that $C \subseteq A \cup B$. Show that $C \subseteq A$ or $C \subseteq B$.
We want to show if $C$ is a connected set then closure of $C$, i.e. $\bar{C}$ is connected.
Claim : $\bar{C}$ is connected
To show the claim we assume that $\bar{C}$ is disconnected. If we do so, we need to reach a contradiction which is possibly would be $C$ is disconnected.
Proof:
Suppose $C$ is a connected set and $\bar{C}$ is not connected.
Since $\bar{C}$ is a disconnected set, there exist two non-empty sets $A$ and $B$ which satisfy the following:
1- $A \ne \emptyset$ and $B \ne \emptyset$
2- $A \cap \bar{B} = \emptyset = A \cap \bar{B} $
3- $\bar{C}= A \cup B$
Using the fact $C \subseteq \bar{C}$ $\rightarrow C \subseteq A \cup B$.
Now using the fact that $A$ and $B$ are two separated sets and $ C \subseteq A \cup B$, we can use the very first fact so
$C \subseteq A$ or $C \subseteq B$
WLOG, asume that $C \subseteq A$ so $C \cap B = \emptyset $
From this point how can we prove $C$ is disconnected to reach to contradiction to the first assumption.
My guess is we need two non-empty sets $U$ and $V$ which have the following criteria:
1- $U \ne \emptyset$ and $V \ne \emptyset$
2- $U \cap \bar{V} = \emptyset = U \cap \bar{V} $
3- $C= U \cup V$
But what are they?
In this answer I show that $A$ and $B$ are both open (and closed) in the subspace $A \cup B$. Now if $C \subseteq A \cup B$, it's immediately clear that $A \cap C$ and $B \cap C$ cannot both be non-empty, or else these two sets would form a disconnection of $C$ by definition. So one intersection is empty and $C$ is contained in the other.
This reproves the fact.
Following your proof outline, you suppose that $\overline{C} = A \cup B$ with $A$ and $B$ completely separated in $\overline{C}$ (!), not $X$ (connectedness is an intrinsic property). Condition 2 has closures taken in $\overline{C}$.
Then $A$ and $B$ are disjoint and closed in $\overline{C}$ and so disjoint and closed in $X$ as well, so separated. Apply the fact to conclude that (say) $C \subseteq A$ and thus $\overline{C} \subseteq \overline{A} = A$ and this implies $B= \emptyset$, a contradiction. Done.
The structure of the proof is thus : assume $\overline{C}$ disconnected using some disconnection, then use that $C$ is connected to see that the disconnection couldn't be a real disconnection. The connectedness of $C$ use is "hidden" in the lemma, so the final proof is almost nothing.
We can slightly generalise the result by stating it as (which is the proposition I have been taught, way back in "metrische topologie"):
which has almost the same proof.