Continuous expanding self mapping between compact metric spaces I'm stuck with this exercise:
Let $K$ be a compact set in a metric space $(X,d)$ and let the self mapping $ f:K \rightarrow K$ be continuous and expanding (i.e $d(f(x),f(y)) \ge d(x,y) \ \forall x,y \in K$). Show that $f(K)=K$.
In my attempt I've already shown that $f$ is a homeomorphism from $K$ to $f(K)$. Now I want to show the double inclusion: $f(K) \subset K$ is clear, but I'm stuck with $K \subset f(K)$.
My idea was to procede via contradiction and maybe after use a Fix Point theorem, i.e suppose that $\exists \ k \in K \ s.t \ k \notin f(K)$. But now I'm stuck.
Any help or suggestion would be greatly appreciated, thank you in advance.
 A: Suppose that $f$ were not surjective, then there is some $p \in  X\setminus f[X]$ and $f[X]$ is compact so we can pick some $\varepsilon$ such that $0 < \varepsilon < d(p,f[X])$. Now $X$ can be covered by finitely many open sets of diameter $< \varepsilon$ and let $N$ be the smallest size of such a cover (well-defined by well-orderedness of $\Bbb N$) and let $\{O_1,\ldots,O_N\}$ be a witnessing cover of $X$. The point $p$ must be covered, say $p \in O_j$. Then by the choice of $\varepsilon$ and the fact that all $O_i$, so $O_j$ too has diameter smaller than that, $f[X]$ is covered by $\{O_i: 1 \le i \le N, i\neq j\}$ and as $f$ is expanding, $\operatorname{diam}(f^{-1}[O_i]) \le \operatorname{diam}(O_i)< \varepsilon$ for all $i$ (for, $x,y \in f^{-1}[O]$ implies $f(x),f(y) \in O_i$ and $d(x,y) \le d(f(x),f(y)) \le \operatorname{diam}(O_i)$), and so $X$ is in fact covered already by $\{f^{-1}[O_i]: 1 \le i \le N, i \neq j\}$ (see where $f(x)$ is and $x$ is in its pullback) which has $N-1$ many open sets (by continuity of $f$) of diameter $< \varepsilon$. This contradicts the minimality of $N$, so our assumption that $f$ was not surjective is false.
So you're done showing it a homeomorphism of $X$.
A: Here are the steps of this exercise presented in the book by J.S. Raymond, Topologie, Calcul Différentiel et Variable Complexe (Chapter III, Espaces Compacts, Exercice 2).
1) Show that $f$ is injective and deduce that $X$ is homeomorphic to $f(X)$ via $f$.
2) Show that for any $a \in X$, $a$ is an adherent value to the sequence $(f^n(a))_n$ (i.e. there exists a subsequence such that $f^{k(n)}(a) \to a$).
Hint: By contradiction, assume that there exists $\delta >0$ such that $d(a, f^n(a))\ge \delta$ for all $n\ge1$, then for all $p\ge0$, $d(f^p(a), f^{p+n}(a)) \ge \delta$, and arrive to the desired contradiction by concluding that $(f^n(a))_n$ could not have a convergent subsequence.
3) Show that $f(X)$ is closed and that all points $a \in X$ are in the closure $cl(f(X))$. Conclude the surjectivity. 
This should answer your question. Please let me know if further clarification is needed. 
We can go on to show that $f$ is actually an isometry. Let us do so.
4) We equip $Y=X \times X$ with the distance $d((x,y),(x',y')) = \max(d(x,x'),d(y,y'))$.
Show that the function $g:Y \to Y$ given by $g(x,y) = (f(x),f(y))$ satisfies $d(g(z), g(z')) \ge d(z,z')$. Deduce that for all $(a,b) \in X$ and all $\varepsilon>0$, there exists $n_{\varepsilon} \ge 1$ such that $\max (d(a, f^{n_{\varepsilon}}(a)), d(b, f^{n_{\varepsilon}}(b)) < \varepsilon $, and then that $$d(a,b) \le d(f(b),f(a)) \le d(f^{n_{\varepsilon}}(a), f^{n_{\varepsilon}}(b)) \le d(a,b) + 2 \varepsilon .$$
5) Finally, conclude that $f$ is an isometric homeomorphism.
