Contractive mapping on compact space 
A contractive mapping on $M$ is a function $f$ from the metric space $(M,d)$ into itself satisfying $$d(f(x),f(y))<d(x,y)$$ whenever $x,y\in M$ with $x\ne y$. Prove that if $f$ is a contractive mapping on a compact metric space $M$, there exists a unique point $x\in M$ with $f(x)=x$.

Consider the function $g(x)=d(f(x),x)$. Note that 
\begin{align*}d(f(x),x)-d(f(y),y)&\leq (d(x,y)+d(y,f(x))-(d(y,f(x)-d(f(x),f(y)) \\
&=d(x,y)+d(f(x),f(y)) \\
&<2d(x,y) 
\end{align*}
And similarly for $d(f(y),y)-d(f(x),x)$, so we have $|d(f(x),x)-d(f(y),y)|<2d(x,y)$. This means $g(x)$ is continuous.
So $g(x)$ is a real-valued continuous function on a compact space, so must be bounded and has a minimum $c$, i.e. there exists $x_0$ such that $d(f(x_0),x_0)$ equals the minimum $c$. What then?

If $f(x_0) \not= x_0$, then $c > 0$ and $d(f(f(x_0)),f(x_0)) < d(f(x_0),x_0) = c$, which is a contradiction. Thus $f(x_0) = x_0$. Uniqueness is pretty easy to show.
