Example of a countable compact set in the real numbers
What about if we define $H = \{ \frac{1}{n} : n\in \mathbb{N}\} \cup \{0\}$, a sort of standard countable compact set with 0 at its sole limit point, then define your countable compact set to be:
$$S = \{ x + y \mid x, y \in H\}.$$
To unpack the thought behind this definition:
- This set $S$ is countable.
- This set $S$ is bounded, because its smallest member is 0 and its largest member is 1+1 = 2.
- Each $x \in H$ is a limit point of $S$. If we fix $x$ and vary $y\in H$ in the definition of $S$, we can see that $x$ is a limit point of $S$.
- This set $S$ is closed (and therefore compact, because it is a bounded subset of the real line.) ($S$ is closed because it is the sum of two compact subsets of $\mathbb{R}$ and is therefore closed in $\mathbb{R}$.)
HINT: Start with $\{0\}\cup\left\{\frac1n:n\in\Bbb Z^+\right\}$, and figure out how to add for each $n\in\Bbb Z^+$ a sequence between $\frac1{n+1}$ and $\frac1n$ converging downwards to $\frac1{n+1}$.
First consider the set:
$$A=\left\{ \frac{1}{n}:n\in\mathbb{Z}^+\right\}\cup\{0\}$$
For each $n>1$, take a sequence $\{\varepsilon_k^n\}_{k=1}^\infty$ such that $\frac{1}{n}<\varepsilon^n_k<\frac{1}{n-1}$, and $\varepsilon_k^1>1$ such that
$$\lim_{k\to\infty}\varepsilon_k^n=\frac{1}{n}$$
Put $$K=A\cup \{\varepsilon_k^n:n,k\in\mathbb{Z}^+\}$$
Notice that this $K$ works.