Let $(X,d)$ be a compact metric space and $f:X\rightarrow X$ be a function such that $$d(f(x),f(y))<d(x,y)$$ for all $x,y\in X$. Show that there exists $c\in X$ such that $f(c)=c$.
Remark: Initially I thought that it was a simple consequence of Banach's fixed point theorem, but everything is complicated because I can not associate this theorem with this problem.
By contradiction suppose that for all $x\in X$ we have $f(x)\neq x$. Therefore, we consider the function $g:X\rightarrow \mathbb{R}^{+}$ defined by $$g(x)=d(f(x),x).$$ Note that $g(x)>0$ for all $x\in X$ and $g$ is continuous (becasue $f$ is continuous and triangle inequality), then there exists $c\in X$ such that $g(c)\leq g(x)$ for all $x\in X$ (because $X$ is compact and $f$ continuous). But by hypotesis we have $$d(f(x),f(y))<d(x,y).$$ Then $$g(f(c))=d(f(f(c)),f(c))<d(f(c),c)=g(c).$$ This is a contradiction.