Prove that $ S=\{0\}\cup\left(\bigcup_{n=0}^{\infty} \{\frac{1}{n}\}\right)$ is a compact set in $\mathbb{R}$.

Solution 1:

We have to use the definition of a compact set here. The latter set is not compact since you can come up with its open cover $B(\frac1n,2^{-n})$ which does not have a finite subcover (why?). The former set is compact since it is closed and bounded.

Solution 2:

Hint: Suppose you have an open cover $\{U_\alpha\}$ of $S$. Now at least one $U_\beta$ contains $0$. Then because $1/n \to 0$ this means $U_\beta$ contains all but finitely elements of $S$. Thus.....