Problem

Source: 2017 Korea Winter Program Practice Test 1 Day 2 #2

Tags: function, number theory



Find all functions $f : \mathbb{N} \to \mathbb{N}$ satisfying the following conditions: For every $n \in \mathbb{N}$, $f^{(n)}(n) = n$. (Here $f^{(1)} = f$ and $f^{(k)} = f^{(k-1)} \circ f$.) For every $m, n \in \mathbb{N}$, $\lvert f(mn) - f(m) f(n) \rvert < 2017$.