Prove there is no contraction mapping from compact metric space onto itself This question is from Foundations of mathematical analysis by Richard Johnsonbaugh

The thing with this question is that there is a question that seems to prove the opposite claim Prove the map has a fixed point - someone look into this
How should one go about dealing with this question?

This probably works.
Define a distance function $r:M\rightarrow M$ such that 
$$
r(x,y) = d(x,y).
$$
Note that $r(\cdot)$ is a continuous function, whose proof can be seen here:
Is the distance function in a metric space (uniformly) continuous?
Thus, since $r$ is continuous on compact $M$, it attains its supremum, say at $(x^\ast, y^\ast)$. Note that $f(x^\ast),f(y^\ast)\in M$, which means that 
$$
r(f(x^\ast),f(y^\ast)) = d(f(x^\ast),f(y^\ast)) \leq d(x^\ast, y^\ast)
$$
by definition of $(x^\ast, y^\ast)$ resulting in a contradiction.
