Question:
Let $(X, d)$ be a metric space such that for every subset $E$ satisfying $E\neq \emptyset$, $E\neq X$, we have $\overline{E}\cap\overline{X\setminus E}\neq \emptyset$. Prove that $X$ is connected. (overlines indicate closures)
Solution:
Assume for a contradiction that $X$ is not connected. Then there exist nonempty sets $A, B\subset X$ such that $X=A\cup B$ and $\overline{A} \cap B = \emptyset$, $A\cap \overline{B}=\emptyset$. In particular $A$ and $B$ are disjoint, so $B = X\setminus A$. Note that $A\neq \emptyset$ by assumption, and $A\neq X$ because $X\setminus A = B \neq \emptyset$. Hence $\overline{A}\cap \overline{X\setminus A}\neq \emptyset$, i.e. $\overline{A}\cap \overline{B}\neq \emptyset$. So let $x\in \overline{A}\cap \overline{B}$, i.e. $x\in \overline{A}$ and $x\in \overline{B}$. $x\in X = A\cup B$, so $x\in A$ or $x\in B$. If $x\in A$, then $x\in A\cap \overline{B}$, so $A\cap \overline{B}\neq \emptyset$. If $x\in B$, then $x\in \overline{A}\cap B$, so $\overline{A}\cap B\neq \emptyset$. Both cases lead to a contradiction. Hence $X$ is connected.
Confusion:
I basically proved it the exact same way but I got stuck trying to show that $x$ is indeed in $X$ (I just assumed at first and then felt that I can't necessarily do that). So $X = A\cup B$, but $x\in \overline{A}\cap\overline{B}$ could be such that $x$ is a limit point of both that is not also in either $A$ or $B$, since we have no information on whether $X, A, B$ are closed. I am not sure how you show that $x\in X$. The solution states that $X$ is actually closed (not in the question statement), but I don't see how.
$X$ is connected iff no proper non-empty subset of $X$ has empty boundary.
With this in mind: https://math.stackexchange.com/questions/118460/x-is-connected-iff-forall-a-subset-x-partial-a-neq-emptyset?rq=1
– J. De Ro Dec 09 '19 at 10:55