The only connected sets in $\mathbb{R}$ are intervals and the compact sets are the closed and bounded ones. So, the only compact connected sets are closed and bounded intervals, i.e. intervals of the form $[a,b]$