Problem

Source: Switzerland Final Round 2021 P6

Tags: function, algebra, nice problem



Let $\mathbb{N}$ be the set of positive integers. Let $f: \mathbb{N} \rightarrow \mathbb{N}$ be a function such that for every positive integer $n \in \mathbb{N}$ $$ f(n) -n<2021 \quad \text{and} \quad f^{f(n)}(n) =n$$Prove that $f(n)=n$ for infinitely many $n \in \mathbb{N}$