This was a problem for my past paper, here is my attempt to solve it. I know there is an easier solution, but I want to verify if my solution is correct.
Proof. Suppose we can find a bound $1> \delta > 0$ such that $$d(f(x),f(y))< \delta d(x,y)$$
Then we are done using the Banach Fixed Point Theorem, since compact metric spaces are complete.
Now assume no such $\delta$ exists. Then we can find sequences $a_i, b_i$ such that $\frac{d(f(a_i), f(b_i)}{d(a_i,b_i)} \rightarrow 1$. Then since a compact metric space is sequentially compact, $a_i$ has a convergent subsequence $a_{i_j} \rightarrow a$ and $b_{i_{j_r}} -> b$. Then we have (by continuity of f) d(f(a), f(b)) = d(a,b). This is a contradiction.
