I'm not sure if this is a good approach (I know there is a different proof that involves a function $a\mapsto d(a,f(a))$ whose minimum is the unique fixed point):
For any $a\ne b\in M$ we have that $d(f(a),f(b))<d(a,b)$ equivalently there exists $k(a,b)\in[0,1)$ such that $d(f(a),f(b))\le kd(a,b)$
Let's impose that $k:M\times M\mapsto[0,1)$ is is the smallest $k\in[0,1)$ such that $d(f(a),f(b))\le k d(a,b)$ for a given $(a,b)\in M\times M$
I think $k$ is continuous because $f$ is continuous (by choosing $\delta = \varepsilon$), but I don't know how to prove that.
Once we have that $k$ is continuous, since $M\times M$ is compact it has a maximum, $k^*\in[0,1)$ and now we have all we need to apply Banach's fixed point theorem to $f:M\mapsto M$ which is a $k^*$-contraction and because $M$ is complete as a compact space.
Let $f(x) = \sin x$ for $0\le x\le 1$. Then by mean value theorem, there exists $c\in (x,y)$ such that $$ |f(x)-f(y)| = \cos c\cdot |x-y|<|x-y| $$ for all $x\ne y$. This shows $f$ satisfies the condition of the problem. However, $$k(x,y) =\frac{|\sin x-\sin y|}{|x-y|}, \quad x\ne y$$ can be arbitrarily close to $1$ near $(0,0)$ as we can see from MVT and $\lim\limits_{c\to 0}\cos c= 1$. Hence there is no $k^*<1$ such that $k(x,y)\le k^*$. Unfortunately, Banach's fixed point theorem cannot be applied in this case, thus it cannot be a general approach to the problem.