I'm trying to construct a countable compact metric space such that for all $n$, its nth derived set is non-empty.
My attempt: Let $A = \{0\} \cup \left\{\frac{1}{n}: n \geq 2\right\}$. Consider $$A_1 = A \cup \left\{\frac{1}{n} + \frac{1}{k}\left(\frac{1}{n-1}-\frac{1}{n}\right): k \geq 2\right\}.$$ I'm basically constructing a sequence that approaches each point in $A$ from the right. Repeat this process; for $i \in \mathbb{N}$, $A_{i+1}$ is the union of $A_i$ along with all the sequences that approach each point in $A_i$ from the right. However, $\bigcup_{ i \geq 1}A_i$ is not closed in this case.
Is there any hint or suggestion?