The set X= {0, 1, 1/2, 1/3, ..., 1/n,...}, that is, the set containing the sequence 1/n for n any positive integer and 0, is both closed (because it contains the limit of the sequence) and bounded (it obviously lies in [0, 1]) and so, as a subset of the real numbers, is compact. To prove that directly from the definition of "compact" I would do the following:
Suppose \{U_n\} is a open cover for X. Then 0 is in one of those sets- rename it U0. Since U0 is open, there exist some r such that the interval (-r, r) is a subset of U0. There exis some integer N, such that N> 1/r and so 1/N< r. That means that for all n\ge N, 1/n< r and so is contained in U0. We then choose a set from the open cover containing 1/n for every n< N, a finite number of sets, and those, together with U0 form a finite sub-cover.
Notice that is essential that 0 be in this set. The set {1, 1/2, ..., 1/n, ...} itself is bounded but not closed and so not compact. For every integer n, Let Un be the interval from (2n+1)/(2n(n+1)) to (2n-1)/(2n(n-1)). The point of that is that (2n+1)/(2n(n+1)) is exactly half way between 1/n and 1/(n+1) while (2n-1)/(2n(n-1)) is exactly half way between 1/n and 1/(n-1). That is, that interval includes ONLY the point 1/n from this set. Since each set in the cover includes only one point of the set, we have to have all of them to cover the set- and we certainly can't reduce to a finite cover.