The statement is equivalent to proving that $\mathbb{R}$ is not the union of two disjoint nonempty open sets. Indeed, if $\mathbb{R}$ is the disjoint union of nonempty open sets (more than one), then taking one of them and the union of the others, you obtain $\mathbb{R}$ as the disjoint union of two nonempty open sets.
Suppose $\mathbb{R}=A\cup B$, with $A$ and $B$ disjoint, open and nonempty. Since the complements of open sets are closed, $A$ and $B$ are also closed.
Let $a\in A$ and $b\in B$; without loss of generality, $a<b$.
Consider $S=\{x\in\mathbb{R}:a\ge x, [a,x]\subseteq A\}$. The set $S$ is upper bounded (by $b$) and not empty (because $a\in S$). Therefore $s=\sup S$ exists. Since $A$ is closed and $S\subseteq A$, we have that $s\in A$, because the supremum of a set belongs to its closure.
I claim that $s\in S$. Indeed, if $[a,s]\not\subseteq A$, then there is $t\in [a,s]\cap B$ and $a<t\le s$. Since $B$ is open, there is $\varepsilon>0$ such that $(t-\varepsilon,t+\varepsilon)\subseteq B$. Note that $t-\varepsilon>a$, because $a\in A$. On the other hand, since $s=\sup S$, there is $x\in S$ with $t-\varepsilon<x\le s$, a contradiction because $[a,x]\subseteq A$.
Since $A$ is open, there exists $\delta>0$ such that $(s-\delta,s+\delta)\subseteq A$. But then $[a,s+\delta/2]\subseteq A$, contradicting the fact that $s=\sup S$.
This is the proof that $\mathbb{R}$ is connected. A straightforward modification shows that every interval in $\mathbb{R}$ is connected.