TITLE: Example of a countable compact set in the real numbers
QUESTION [11 upvotes]: Can someone give me an example or a hint to come up with a countable compact set in the real line with infinitely many accumulation points?
Thank you in advance!

REPLY [2 votes]: Let $a_0=0$ and let $(a_n)_{n\in N}$ be a strictly increasing sequence of members of $(0,1)$ with $\lim_{n\to \infty}a_n=1.$
For each $n\in N$ (i.e. $n>0$) let $(b_{n,j})_{j\in N}$ be a strictly increasing sequence of members of $[a_{n-1},a_n)$ with $b_{n,1}=a_{n-1}$ and $\lim_{j\to \infty}b_{n,j}=a_n.$ 
Let $S=\{b_{n,j}:n,j\in N\}\cup \{1\}.$ Then S is closed and bounded, hence compact, and the set of accumulation points of $S$ is $\{a_n:n\in N\}\cup \{1\}.$