Let $f:K \rightarrow N$ be a continuous function from a compact $K$. Show that $f$ is uniformly continuous I'm having trouble finishing this. One approach that I made is this:
Let $\epsilon > 0$. Then, since $f$ is continuous, for every $x \in K$ exists $\delta_x > 0$ such that $d(x, x')<\delta_x \Rightarrow d'(f(x),f(x')) < \epsilon$.
Then $B=\{B(x, \delta_x)\}_{x\in K}$ covers $K$. Since $K$ is compact, I can take finite amount of this $B_x$ and they cover $K$. Let's say that $K = \cup_{i=1}^n B(x_i, \delta_{x_i})$. Let $\delta = min\{\delta_{x_i}\}$ I would like here to say that if $d(x, y) < \delta \Rightarrow d'(f(x), f(y)) < \epsilon$. But I can't. If $x,y \in B(x_i, \delta_{x_i})$ for some $i$, then everything is fine. But I can take two point $x,y$ as close as I want, but being on different open sets.
 A: You are close. Try this modification: fix $\varepsilon>0$. We can take an open cover $B_{\delta_x}(x)$ around every $x\in K$ so that $d(x,x')<\delta_x$ implies $d'(f(x),f(x'))<\varepsilon$. Now, we can also take an analogous  open cover $\{B_{\delta_x/2}(x):x\in X\}$. Note that there  exists a finite set of indices $i=1,\ldots, n$ such that the $B_{\delta_{x_i}/2}(x_i)$ cover $K$ by compactness. A fortiori, the  same holds for the $B_{\delta_{x_i}}(x_i)$. Define 
$$\delta=\min\{\delta_{x_i}/2: i=1,\ldots,n\}.$$ 
Then if $x,y\in K$ are given so that $d(x,y)<\delta$, note that $x\in B_{\delta_{x_i}/2}(x_i)$ for some $i$. Now, 
$$ d(y,x_i)\le d(y,x)+d(x,x_i)<\delta+\frac{\delta_{x_i}}{2}\le\frac{\delta_{x_i}}{2}+\frac{\delta_{x_i}}{2}<\delta_{x_i}$$
so that $y\in B_{\delta_{x_i}}(x_i)$ as is $x$. Then $d'(f(x),f(x'))<\varepsilon$ by the beginning part.
A: Suppose $f$ is not uniformly continuous, i.e. there is $\varepsilon >0$ s.t. $\forall n\in\mathbb N^*$, $\exists x_n,y_n\in K$ s.t. $d(x_n,y_n)\leq\frac{1}{n}$ and $d(f(x_n),f(y_n))\geq \varepsilon $.
1) Using Bolzano-weierstrass, $(x_n)$ has a subsequence $(x_{n_k})$ that converges to $x$.
2) One can prove that $(y_{n_k})$ converges to $x$ as well.
3) Using continuity, $d(f(x_{n_k}),f(y_{n_k}))\to 0$.
Contradiction.
