Solution (source code)

= Solution

Let $(x_n)$ be any <sequence> in the <compact metric space> $X$. There must be an $x\in X$ such that every <open ball> about $x$ contains $x_n$ for infinitely many indices $n$. Otherwise, for each $x\in X$ choose a ball $B(x,r_x)$ containing only finitely many terms, counted by indices. These balls are an <open cover>. A <finite subcover> would imply that only finitely many indices occur anywhere in $X$, a contradiction.

Now choose successively $n_k>n_{k-1}$ with $x_{n_k}\in B(x,1/k)$; infinitely many available indices make this possible. Then $d(x_{n_k},x)<1/k\to0$, so $(x_{n_k})$ is a <convergent subsequence>. Thus
$$
\boxed{\text{compact metric space}\ \Longrightarrow\ \text{sequentially compact space}}.
$$
The proof counts indices rather than distinct points, so it also handles a value repeated infinitely often.