Let $a<b$ be real numbers. Prove that $[a,b]$ is compact.
Below I present my solution. I thought it's good enough, but my TA said it's incorrect. I don't see where there is a problem. Could you help me find it?
My proof:
Let $\{U_i\}_{i\in I}$ be an open cover of $[a,b]$. Let $$S=\{x\in [a,b]: x>a \mbox{ and } [a,x] \mbox{ is covered by a finite union of sets from }\{U_i\} \} \mbox{.}$$
It is clear that $S$ is bounded. Moreover, $S$ is not empty because there is $j\in I$ such that $a\in U_j$. Since $U_j$ is open, there is some $\epsilon>0$ such that $[a,\epsilon) \subset U_j$, therefore $a+\frac{\epsilon}{2}\in S$.
We have showed that $S$ is bounded and not empty so there exists $\sup S$. We claim that $\sup S=b\in S$.
It's obvious that $\sup S \in U_k$ for some $k\in I$ and $\sup S \le b$. Assume $c=\sup S<b$. Then there is $\delta>0$ such that $[c, c + \delta)\subset U_k$ and $[c, c + \delta)\subset [a,b]$. But this means that we can cover $[a,c + \frac{\delta}{2}]$ by finitely many sets from $\{U_i\}$, so $c$ is not the supremum. Thus it must be the case that $\sup S=b$.