Is this proof fine or does it lack rigor? Please help me spot mistakes or improve on it. Thanks!
Proof Attempt: Let $C$ be compact, so it must be closed and bounded due to the Heine-Borel Theorem. Consider the open interval $(a,b)$ and, w.l.o.g., suppose that $C\cap(a,b)=[a,x]$. Then $(a,x]\nsubseteq C\setminus (a,b)$, but $a\in C\setminus (a,b)$. For the sake of contradiction, suppose $C\setminus (a,b)$ is not closed, then $C\setminus (a,b)$ does not contain all its points of closure; that is $\exists$ a point $p$ of $C\setminus (a,b)$ such that $\in(a,x]$, then $a<p\leq x$ which implies $\exists\delta>0$ such that $(p-\delta, p+\delta)\cap C\setminus (a,b)=\emptyset$. So $\forall y\in(a,x]$, $y$ cannot be a point of closure of $C\setminus (a,b)$ ~ a contradiction.
EDIT
Attempt(Direct Approach): Let $U$ be an open cover of $C\setminus (a,b)$ such that $C$ is closed and bounded. Since $U\cup\{(a,b)\}$ is an open cover of $C$. But, $C$ is compact so $U\cup\{(a,b)\}$ has a finite subcover. Knowing that $\{(a,b)\}$ does not cover $C\setminus (a,b)$ then $U$ must be finite.