Contracting a metric space

The following problem comes from this nice book (and I suppose also from other sources).
As anybody knows a contraction on a metric space has a fixed point.
Now suppose $(X,d)$ is a metric space and $f:X\to X$ is not exactly a contraction but satisfy $d(f(x),f(y))
Suppose also that X is compact, then a fixed point $x_0$ must exists for $f$ and $f^n(x) \to x_0$ for any $x$.

Here is a hint

Here is a solution sketch