TITLE: Isometry in compact metric spaces
QUESTION [20 upvotes]: Why is the following true?  

If $(X,d)$ is a compact metric space and $f: X \rightarrow X$ is non-expansive (i.e $d(f(x),f(y)) \leq d(x,y)$) and surjective then $f$ is an isometry.

REPLY [4 votes]: Here's a different argument. Recall that an $\epsilon$-covering $S$ of a metric space is a set such that for every point $x$ there exists $s\in S$ with $d(x,s)\leq \epsilon.$

Lemma. Let $X$ be a metric space with a finite $\epsilon/4$-cover. If $f:X\to X$ is a non-expansive surjection then $d(f(x),f(y))\geq d(x,y)-\epsilon$ for all $x,y\in X.$
Proof:  Set $D=d(x,y)-\epsilon/2.$ Let $S$ be an $\epsilon/4$-cover minimizing the quantity $N(S)=|\{(s_1,s_2)\in S\mid d(s_1,s_2)\geq D\}|.$
  Note that $f(S)$ is also an $\epsilon/4$-cover, and whenever $d(s_1,s_2)< D$ we have $d(f(s_1),f(s_2))< D.$ But $N(f(S))\geq N(S),$ so no pair can go from distance $\geq D$ to $<D:$ whenever $d(s_1,s_2)\geq D$ with $s_1,s_2\in S,$ we must have $d(f(s_1),f(s_2))\geq D.$
Pick $s_1,s_2\in S$ with $d(s_1,x),d(s_2,y)\leq \epsilon/4$; this gives $d(s_1,s_2)\geq d(x,y)-\epsilon/2,$ which we argued implies $d(f(s_1),f(s_2))\geq d(x,y)-\epsilon/2.$ So $d(f(x),f(y))\geq d(x,y)-\epsilon.$ $\Box$

To get the result in the question, note that a compact space is totally bounded i.e. has a finite $\epsilon$-covering for each $\epsilon.$