TITLE: Continuous mapping on a compact metric space is uniformly continuous
QUESTION [85 upvotes]: I am struggling with this question:

Prove or give a counterexample: If $f : X \to Y$ is a continuous mapping from a compact metric space $X$, then $f$ is uniformly continuous on $X$. 

Thanks for your help in advance.

REPLY [3 votes]: $f:X\rightarrow Y$ is uniformly continuous iff for every pair of sequences $(x_n),(y_n)$ in $X$ satisfying $d(x_n,y_n)\rightarrow 0$ we have $d(f(x_n),f(y_n))\rightarrow 0$. Now let $(a_n)$ be any subsequence of $(x_n)$ and $(b_n)$ be that of $(y_n)$. X being compact, $(a_n)$ has a convergent subsequence $(a_{n_k})$ and $(b_{n_k})$ has a convergent subsequence $(b_{n_{k_l}})$. But since $d(x_n,y_n)\rightarrow 0$ the limits must be the same, say, $l$. And since $f$ is continuous, $f(a_{n_{k_l}})\rightarrow f(l)$ and $f(b_{n_{k_l}})\rightarrow f(l)$. Hence, $d(f(a_{n_{k_l}}),f(b_{n_{k_l}}))\rightarrow 0$. So that every subsequence of $d(f(x_n),f(y_n))$ has a further subsequence converging to $0$. This proves $f$ to be uniformly continuous.