Suppose that $(X, d)$ is a compact metric space and that $f : X \to X$ is a continuous function satisfying $d(x, y)\leq d(f(x), f(y))$ for all $x, y \in X$. Then $f(X) = X$.
I tried to do this as the following but my professor told me that it is not working, because of the following;
Suppose by contradiction that $f(X)\neq X$ and $d(x, y)\leq d(f(x), f(y))$ is satisfied. Also since, $f$ is continuous on a compact set is takes its maximum. So $\exists a \in X$ s.t. $d(x,f(x)) \leq d(a,f(a)) \forall x\in X$.
(but he said that $f(a)$ be maximum does not mean that $d(a,f(a)) $ is the maximum) I did not understand his point.
then let $a=x$ and $y=f(a)$, using the property we'd have $d(a,f(a)) \leq d(f(a),f(f(a))) $. So if $f(x) \neq x$, this is a contradiction.
I also have another proof which he gave, but cannot understand it. Is there any alternative proof doing it by contradiction ?
Okay. Here's a somewhat simple proof of the fact:
Assume for contradiction $y\in X\setminus f(X)$. In particular, since $f(X)$ is compact, there exists some $\varepsilon>0$ such that $B(y,\varepsilon)\cap f(X)=\emptyset$. In particular, $d(y,f(y))\geq \varepsilon$. However, applying the property of $f$, we have $d(f(y),f(f(X))\geq \varepsilon$, and in particular $d(f(y),f(f(y))\geq \varepsilon.$
Proceeding by induction, let $f^{\circ n}$ denote the $n$'th composition of $f$ with itself and note that the sequence $(f^{\circ n}(y))_{n\in \mathbb{N}}$ satisfies that $d(f^{\circ n}(y),f^{\circ k}(y))\geq \varepsilon$ whenever $n\neq k$. Thus, this sequence cannot have a subsequence which is Cauchy, and in particular, it cannot have a convergent subsequence. This contradicts compactness of $X$, and we conclude that $y\in f(X)$