Why is a continuous mapping from a compact metric space to another metric space is uniformly continuous? [duplicate]

This question already has an answer here:

Why is a continuous mapping from a compact metric space to another metric space is uniformly continuous? This theorem is from Rudin Real Analysis Page 202.

marked as duplicate by user99914, user223391, Daniel W. Farlow, user228113, M. VinayJun 12 '16 at 4:11

Let $f:X\rightarrow Y$ be a continuous map defined on metric spaces such that $X$ is compact. Suppose it is not uniformly continuous, there exists $c>0$ such that for every integer $n$, there exists $x_n,y_n$ such that $d(x_n,y_n)<1/n$ and $d(f(x_n),f(y_n))>c$, you can extract a subsequence $(x_{n_k})$ from $(x_n)$ which converges towards $x$, $(y_{n_k})$ converges towards $x$, this implies that $lim_nd(f(x_{n_k}),f(y_{n_k})=0$. This is impossible since $d(f(x_{n_k},f(y_{n_k})\geq c$
• I believe a continuous map $f:X\rightarrow Y$ such that $X$ is compact – Tsemo Aristide Jun 11 '16 at 23:23