In my textbook there is a theorem saying that "If $S\subset\mathbb{R}$ is an interval, then $S$ is connected." I can follow most of the arguments provided there except the one indicated below. Can anyone help me understand it, please? To be complete, I briefly state the proof in my textbook.
$\textit{Proof.}$ Suppose $S$ is an interval in $\mathbb{R}$ and $S$ is not connected. Then there exist nonempty open sets $U$ and $V$ in $S$ such that $$S=U\cup V, U\cap V=\emptyset.$$ Choose $a\in U$ and $b\in V$. Without loss of generality we may assume that $a<b$. Since $S$ is an interval, $[a, b]\subset S$.
$\textit{My question is with the following argument.}$ (Arguments thereafter are omitted.)
Let $c=\mathrm{sup}([a, b]\cap U)$. Since $c\in [a, b]\subset S$, so either $c\in U$ or $c\in V$. Why is $c$ must be in $[a, b]$, please?