Proof Explanation - $\Bbb R$ is connected, i.e. has no non-trivial clopen subsets I know that $\Bbb R$ is connected iff it has no non-trivial clopen subsets. To show that $\Bbb R$ has no non-trivial clopen subsets, I came across the following solution which I need help in understanding.

Assume for a contradiction that $A$ is a clopen subset of $\mathbb R,\ $ $\emptyset\ne A\ne\mathbb R.$ Choose $a\in A$ and $b\in\mathbb R\setminus A.$ Without loss of generality, we may assume that $a\lt b.$ Let $c=\sup(A\cap[a,b]).$ Since $A$ is closed we have $c\in A,$ and so $a\le c\lt b.$ Now $c\in A$ and $(c,b]\subseteq\mathbb R\setminus A,$ contradicting the assumption that $A$ is open.

(Cited from this answer.)
I have some questions:

*

*What motivated the choice $c=\sup(A\cap[a,b])$?

*Since $A$ is closed, we have $c\in A$ - why is that? (Once $c\in A$, we know that $c\neq b$ and in fact $c < b$. Since $c$ is $\sup$ of $A\cap[a,b]$, $c \ge a$ is also clear).

*Why is $(c,b]\subseteq\mathbb R\setminus A$, and how does it contradict the assumption that $A$ is open?

Thanks a lot!
 A: 
What motivated the choice $c=\sup(A \cap [a,b])$?

The proof basically chooses a point in $A$ ($a$) and a point outside it ($b$). The goal of the proof here is to look at what happens as you go from $a$ to $b$, because you have to "get out" of the set $A$ in some sense. The contradiction arises from the fact that the "edge" of the set cannot be both open and closed. (Obviously this explanation is not meant to be rigorous, but I think it motivates the choice nicely)

Since $A$ is closed, we have $c \in A$

Because closed sets contain all of their boundary points, and the set $A \cap [a,b]$ is closed (as it is the intersection of two closed sets), and its supremum is its boundary point

Why is $(c,b] \subseteq \mathbb R \setminus A$

Because $c$ was the defined as the supremum of $[a,b] \cap A$, so if $(c, b]$ contained more points from $A$, then $c$ wouldn't be the supremum

and how does it contradict the assumption that $A$ is open?

We saw that $c$ is in $A$, and $A$ is assumed to be open, meaning that every point in $A$ (including $c$) has an open ball around it that is still within $A$. But you can see that there can be no such ball, because for any $r > 0$, $c + r$ is already not in the set $A$
