Here is Prob. 10, Chap. 4 in the book Principles of Mathematical Analysis by Walter Rudin, 3rd edition:
Complete the details of the following alternative proof of Theorem 4.19: If $f$ is not uniformly continuous, then for some $\varepsilon > 0$ there are sequences $\left\{ p_n \right\}$, $\left\{ q_n \right\}$ in $X$ such that $d_X \left( p_n, q_n \right) \to 0$ but $d_Y \left( f\left( p_n \right), f\left(q_n\right) \right) > \varepsilon$. Use Theorem 2.37 to obtain a contradiction.
Now here is Theorem 4.19 in Baby Rudin, 3rd edition:
Let $f$ be a continuous mapping of a compact metric space $X$ into a metric space $Y$. Then $f$ is uniformly continuous on $X$.
And, here is Theorem 2.37:
If $E$ is an infinite subset of a compact set $K$, then $E$ has a limit point in $K$.
Finally, here is Theorem 3.6 (a):
If $\left\{ p_n \right\}$ is a sequence in a compact metric space $X$, then some subsequence of $\left\{ p_n \right\}$ converges to a point of $X$.
It is in the proof of Theorem 3.6 (a) that Rudin has used Theorem 2.37.
Now here is my attempt at Prob. 10, Chap 4 in Baby Rudin:
Suppose $f$ is a continuous mapping of a compact metric space $X$ into a metric space $Y$, and suppose that $f$ is not uniformly continuous on $X$. Then, there is a real number $\varepsilon_0 > 0$, such that, for every real number $\delta > 0$, we can find points $x_\delta$ and $y_\delta$ in $X$ such that $$d_X \left( x_\delta, y_\delta \right) < \delta,$$ but $$d_Y \left( f\left(x_\delta\right), f\left(y_\delta\right)\right) \geq \varepsilon_0.$$ In particular, for $\delta = \frac{1}{n}$, for each $n = 1, 2, 3, \ldots$, we can find points $p_n$ and $q_n$ in $X$ such that $$d_X \left(p_n, q_n \right) < \frac{1}{n},$$ but $$d_Y\left(f\left(p_n\right), f\left(q_n\right)\right)\geq\varepsilon_0.$$ Thus, we have sequences $\left\{p_n\right\}$ and $\left\{q_n\right\}$ in $X$ for which $$\tag{1} \lim_{n\to\infty} d_X\left(p_n, q_n\right)=0,$$ but $$\tag{2} d_Y\left( f\left(p_n\right), f\left(q_n\right) \right) \geq \varepsilon_0 \ \mbox{ for all } n \in \mathbb{N}.$$ Now since $\left\{p_n \right\}$ is a sequence in the compact metric space $X$, so by Theorem 3.6 (a) in Baby Rudin $\left\{p_n\right\}$ has a convergent subsequence $\left\{p_{\varphi(n)}\right\}$, where $\varphi \colon \mathbb{N} \to \mathbb{N}$ is a strictly increasing mapping of $\mathbb{N}$ into $\mathbb{N}$. Let's put $$\tag{3} p \colon= \lim_{n\to\infty} p_{\varphi(n)}.$$ Since $\left\{ d_X\left( p_{\varphi(n)}, q_{\varphi(n)} \right) \right\}$ is a subsequence of $\left\{ d_X\left( p_n, q_n \right) \right\}$, so from (1) we can conclude that $$ \tag{4} \lim_{n \to \infty} d_X \left( p_{\varphi(n)}, q_{\varphi(n)} \right) = 0$$ also. Now we see that $$0 \leq d_X \left( q_{\varphi(n)}, p \right) \leq d_X \left( q_{\varphi(n)}, p_{\varphi(n)} \right) + d_X \left( p_{\varphi(n)}, p \right)$$ for all $n \in \mathbb{N}$, and so using (3) and (4), we can conclude that $$ \lim_{n \to \infty} d_X \left( q_{\varphi(n)}, p \right) = 0,$$ and hence $$\tag{5} \lim_{n \to \infty} q_{\varphi(n)} = p$$ also.
Now as $\left\{ p_{\varphi(n)} \right\}$ and $\left\{ q_{\varphi(n)} \right\}$ are sequences converging to the point $p$ in the metric space $\left(X, d_X \right)$ and as $f$ is a continuous mapping of $\left(X, d_X \right)$ into $\left( Y, d_Y \right)$ (and hence continuous at $p$), so the sequences $\left\{ f\left( p_{\varphi(n)} \right) \right\}$ and $\left\{ f\left( q_{\varphi(n)} \right) \right\}$ converge to the point $f(p)$ in the metric space $\left(Y, d_Y \right)$, and so $$\tag{6} \lim_{n \to \infty} d_Y \left( f\left(p_{\varphi(n)}\right), f\left( q_{\varphi(n)}\right) \right) = d_Y \left( f(p), f(p) \right) = 0.$$ But $\left\{ d_Y\left( f\left(p_{\varphi(n)}\right), f\left( q_{\varphi(n)}\right) \right) \right\}$ is a subsequence of $\left\{ d_Y\left( f\left( p_n\right), f\left(q_n\right) \right) \right\}$. So from (2) and (6) we can conclude that $$0 = d_Y\left( f(p), f(p) \right) = \lim_{n \to \infty} d_Y \left( f\left(p_{\varphi(n)}\right), f\left( q_{\varphi(n)}\right) \right) \geq \varepsilon_0 > 0,$$ which is a contradiction.
Hence our supposition that $f$ is a continuous mapping of a compact metric space $X$ into a metric space $Y$ which is not uniformly continuous on $X$ has led to a contradiction. So if $f$ is a continuous mapping of a compact metric space $X$ into any metric space $Y$, then $f$ must also be uniformly continuous on $X$.
Is this proof correct? If so, is the above presentation of the proof good enough? If not, then where lies the error?
Can we directly use Theorem 2.37 as Rudin has suggested in his hint, without having recourse to Theorem 3.6 (a)?