2. Here is an attempt. It seems you are not trying to use Heine-Borel theorem. Which makes is harder. Let $C$ be defined as in the hint. This set is non-empty because $a\in C$. And it has an upper bound, ii.e. $b$. Thus, by completeness there is a least upper bound $c$. Note, $c\leq b$, we will show $c is impossible. Let $\mathcal{C}$ be an open covering of $[a,b]$. By construction of $C$ it means there exists finitely many open sets $\mathcal{U}_1,...,\mathcal{U}_k$ which cover $[a,c]$. So it means $c\in \mathcal{U}_1$ without lose of generality. But since it is an open set it means there is $\epsilon > 0$ such that $(c-\epsilon,c+\epsilon)\subset \mathcal{U}_1$. Also since $a it means there is $\delta > 0$ such that $a. Let $\eta = \min\{ \delta, \epsilon \}$. Then by construction $(c-\eta,c+\eta)\in \mathcal{U}_1$ and $[a,c+\eta]$ can be covered too. So $c+\eta \in C$. Which contradicts that $c$ is the least upper bound. Thus, it means $c=b$. And so $[a,b]$ is covering compact.