TITLE: $X$ is connected iff $\forall A\subset X,$ $\partial A\neq\emptyset$
QUESTION [5 upvotes]: Prove metric space $X$ is connected iff $\forall A\subset X,$ $\partial A\neq\emptyset$.

Attempt at a proof:
$\rightarrow$ $X$ connected $\implies$ $\forall A\subset X$, $A$ is connected. Then, intuitively there should be no "space" between the sets because if there were, $X$ would not be connected. Not sure how to formalize it, though.
$\leftarrow$ If the boundary is nonempty $\forall A\subset X$, then suppose there exist $U, V$ open in $X$ such that $U,V$ disconnect $X$. Then, (1) $U\cap X\neq\emptyset$ and $V\cap X\neq\emptyset$, while (2) $(U\cap X)\cap (V\cap X)=\emptyset$ and (3) $(U\cap X)\cup (V\cap X)=X$. Then, let $U\cap X= A$. Clearly $A\subset X$ but by (2) $\partial A\cap A^c=\emptyset$. This is a contradiction.
.

REPLY [8 votes]: First, you of course need to assume that $A\neq\emptyset, X$.  
Now, the $(\Rightarrow)$ direction in your proof attempt is not correct.  Take, for example, the closed interval $[a,b]\subset\mathbb{R}$, which is (as you know ...) path-connected, therefore connected.  Put $A=\{a\}\cup\{b\}\subset [a,b]$.  Then $A$ is not connected, although $[a,b]$ is connected.
Instead, try to think about what it means for a boundary to be empty.  Your intuition is on the right path. Here's how you formalize the $(\Rightarrow)$ direction.  Suppose toward contradiction $X$ is connected, but some (nonempty) $A\subset X$ has empty boundary.  Then $A$ is closed, because $A = A\cup \partial A$ is its own closure, hence $X-A$ is open.  Observe that in $X$, $\partial(X-A) = \partial A$, so we must have that $\partial(X-A) = \emptyset$, hence by the same argument as for $A$ we have $X-A$ is closed, so that $A$ is open.  Therefore, $X = A\cup (X-A)$ for two open sets $A$ and $X-A$, and $A\cap (X-A) = \emptyset$, so $A$ and $X-A$ form a disconnect of $X$, contradicting the hypothesis that $X$ is connected.
For the ($\Leftarrow$) direction, how does (2) justify that $\partial A\cap A^c = \emptyset$?  Instead, you need to use the hypothesis that $X$ is a metric space, since this direction is not true for a general topological space (take, e.g., the disjoint union of two intervals).  Prove the contrapositive: if $X$ is disconnected, then there is some nonempty set $A\subset X$ with $\partial A = \emptyset$.  Your intuition is again correct that $A$ will be one of the disconnecting sets.  By the argument above, $X = A\cup B$ for two disjoint clopen sets $A$ and $B$.  But now you're done: $A \supset \partial A = \partial B \subset B$, which tells you that $\partial A = \partial B = \emptyset.$

REPLY [3 votes]: Observe that $\partial A=\emptyset$ iff $A$ is clopen (open and closed) iff $A$, $A^c$ disconnect $X$.