[proofplan]
We prove the stronger sandwich statement: if $Y \subseteq Z \subseteq \overline{Y}$ and $Y$ is connected, then $Z$ is connected (the case $Z = \overline{Y}$ is the main claim). If $Z$ were disconnected as $Z = U \cup V$, the connected set $Y$ would lie entirely in one piece, say $U$. But any point of $V$ lies in $\overline{Y}$ and hence has every open neighbourhood meeting $Y \subseteq U$, contradicting $V \cap U = \varnothing$.
[/proofplan]
[step:Prove the sandwich statement: $Y$ connected and $Y \subseteq Z \subseteq \overline{Y}$ implies $Z$ connected]
Suppose for contradiction that $Z = U \cup V$ with $U, V$ open in $Z$, non-empty, and disjoint. Since $Y \subseteq Z$, we have $Y = (Y \cap U) \cup (Y \cap V)$, where $Y \cap U$ and $Y \cap V$ are open in $Y$ (in the [subspace topology](/page/Subspace%20Topology)) and disjoint. Since $Y$ is connected, one of them must be empty. WLOG $Y \cap V = \varnothing$, so $Y \subseteq U$.
Let $z \in V$ (which is non-empty by assumption). Since $z \in Z \subseteq \overline{Y}$, the point $z$ lies in the [closure](/page/Closure) of $Y$, so every open neighbourhood of $z$ in $X$ meets $Y$. Since $V$ is open in $Z$, there exists an [open set](/page/Open%20Set) $W \subseteq X$ with $V = Z \cap W$. Then $W$ is an open neighbourhood of $z$ in $X$, so $W \cap Y \neq \varnothing$. But $W \cap Y \subseteq Z \cap W \cap Y = V \cap Y = \varnothing$, a contradiction. Therefore $Z$ is connected.
[guided]
The proof exploits the tension between two facts: the disconnection forces $Y$ to lie entirely in one piece (say $U$), but the closure condition forces every point of the other piece ($V$) to be "close to $Y$."
Suppose $Z = U \cup V$ is a disconnection. Since $Y$ is connected and $Y = (Y \cap U) \cup (Y \cap V)$ is a decomposition into relatively open disjoint sets, [connectedness](/page/Connectedness) of $Y$ forces one to be empty. Say $Y \cap V = \varnothing$, so $Y \subseteq U$.
Now pick any $z \in V$. Since $z \in Z \subseteq \overline{Y}$, the definition of closure says: every open set in $X$ containing $z$ must intersect $Y$. We use $V = Z \cap W$ for some open $W \subseteq X$ (this exists because $V$ is open in the subspace topology on $Z$). Then $W$ is open in $X$ and contains $z$, so $W \cap Y \neq \varnothing$.
But here is the contradiction: $W \cap Y \subseteq (Z \cap W) \cap Y = V \cap Y = \varnothing$ (since $Y \subseteq U$ and $U \cap V = \varnothing$). So $W$ is an open neighbourhood of $z$ that does not meet $Y$, contradicting $z \in \overline{Y}$.
The result is sharp: the condition $Z \subseteq \overline{Y}$ cannot be dropped. The closure operation can add points but cannot create disconnections, because any added point is a [limit](/page/Limit) of the original connected set and therefore "glued" to it topologically.
[/guided]
[/step]