Prove expansive function on a compact set is surjective.

Solution by "ifk" at http://www.artofproblemsolving.com/community/c7h360582p1972843 . There, $(X,d)$ is the metric space, and we are to prove $f$ is both surjective and isometric.

Let $x\in X$. Define $x_{0} = x, \ x_{n+1} = f(x_{n})$. By compactness $\{x_{n}\}_{n}$ has convergent (in particular Cauchy) subsequence $\{x_{n_{k}}\}_{k}$. W.l.o.g. $\{n_{k+1} - n_{k}\}_{k}$ is increasing.

We will show that the sequence $\{x_{n_{k+1} - n_{k}}\}_{k}$ converges to $x$. Let $\varepsilon > 0$. Since $\{x_{n_{k}}\}_{k}$ is Cauchy sequence, then for sufficiently large $k$ we've got $d(x_{n_{k}}, x_{n_{k+1}}) < \varepsilon$. Now $d(x_{n_{k}}, x_{n_{k+1}}) \ge d(x_{n_{k+1} - n_{k}}, x)$.

Since $\{x_{n}\}_{n\ge 1} \subset f(X)$ it follows that $f(X)$ is dense in $X$.

Now suppose that $d(f(x), f(y)) > d(x,y)$ for some $x,y\in X$. Define $\{x_{n}\}_{n}$ as before and similarly $y_{0} = y, \ y_{n+1} = f(y_{n})$ By the preceding argument there exist sequence $\{n_{j}\}_{j}\subset \mathbb{N}$ s.t. $x_{n_{j}}\to x, \ y_{n_{j}}\to y$ as $j\to \infty$. Then $$ d(f(x), f(y)) = d(x_{1},y_{1}) \le d(x_{n_{j}},y_{n_{j}})\to d(x,y) $$ so $d(x,y) < d(f(x),f(y) \le d(x,y)$, contradiction.

Therefore $f$ is isometry, in particular continuous mapping. Hence $f(X)$ is compact, in particular complete, in particular $f(X) = \text{cl}(f(X)) = X$. Q.E.D.