Cauchy sequence in compact metric space Suppose $f:X\rightarrow X$ continuous function, $X$ is compact metric space with $\rho(f(x),f(y))<\rho(x,y)$ for any $x\neq y$. Let $x_n=f(x_{n-1})$, with $x_0\in X$ arbitrary. I want to show that $\{x_n\}$ is Cauchy.
What I tried: for $n>m$
$$
\rho(x_n,x_m)\leq \rho(x_n,x_{n-1})+\dots+\rho(x_{m+1},x_m)=\rho(f^{n-1}(x_1),f^{n-1}(x_0))+\dots \rho(f^{m}(x_1),f^{m}(x_0))<(n-m+1)\rho(x_1,x_0)
$$
And I got stuck here.
 A: Let's use the convention $f^n=\underbrace{f\circ\cdots\circ f}_{n\text{ times}}$.
Let $A=\overline{\left\{x_n:n\in\mathbb{N}\right\}}$ be the closure of (the image of) the sequence $(x_n)$. Since $A$ is closed, it is compact, so the sets $f^n(A)$ are also compact (since the $f^n$ are continuous). Also, notice that
$$f(A)\subseteq \overline{\left\{f(x_n):n\geq 0\right\}}=\overline{\left\{x_{n+1}:n\geq 0\right\}}\subseteq A.$$
Since $A\supseteq f(A)\supseteq f^2(A)\supseteq\cdots$ is a nested sequence of compacts, then their intersection $B=\bigcap_{n=0}^\infty f^n(A)$ is nonempty. It's easy to check that $f(B)=B$. Let's show that $B$ is a singleton.
Suppose, by contradiction, that $B$ was not a singleton. Since $B$ is also compact, we could find $a_1\neq a_2$ in $B$ such that $\rho(a_1,a_2)=\operatorname{diam} B$. But also $a_i\in B=f(B)$, thus there are $b_i\in B$ with $a_i=f(b_i)$ (in particular $b_1\neq b_2$), so $$\operatorname{diam }B=\rho(a_1,a_2)=\rho(f(b_1),f(b_2)))<\rho(b_1,b_2)\leq\operatorname{diam} B,$$
an absurd. Therefore, $B$ contains only one point $y$. Again from $f(B)=B$, we have $f(y)=y$.
Finally, suppose that $(x_n)$ was not Cauchy. Then there exists $\epsilon>0$ such that for every $N\in\mathbb{N}$, there are $n,m>N$ with $\rho(x_n,x_m)>\epsilon$.
This allows us to construct an increasing sequence $n_1<m_1<n_2<m_2<n_3<m_3<\cdots$ with $\rho(x_{n_i},x_{m_i})>\epsilon$. By going to a subsequence (in both $n_i$ and $m_i$), we may assume that $x_{n_i}$ and $x_{m_i}$ converge to certain limits $p$ and $q$, respectively. Also $\rho(p,q)\geq\varepsilon>0$, so $p\neq q$. Let's show that $p,q\in B$ (so we reach a contradiction).
Let $n\in\mathbb{N}$ and $\delta>0$. For every $i$ sufficiently large, we have $\rho(x_{n_i},p)<\delta$ and $\rho(x_{m_i},q)<\delta$. By choosing $i$ such that $n<n_i(<m_i)$, we obtain both $x_{n_i}$ and $x_{m_i}\in f^n(A)$. Since $\delta$ was arbitrary and $f^n(A)$ is closed, this proves that $p,q\in f^n(A)$. Since $n$ is arbitrary, this shows that $p,q\in B$, contradicting the fact that $B$ is a singleton.
Therefore, $(x_n)$ is Cauchy.
