Problem

Source: Iran Third Round MO 1998, Exam 2, P1

Tags: function, number theory proposed, number theory



Find all functions $f: \mathbb N \to \mathbb N$ such that for all positive integers $m,n$, (i) $mf(f(m))=\left( f(m) \right)^2$, (ii) If $\gcd(m,n)=d$, then $f(mn) \cdot f(d)=d \cdot f(m) \cdot f(n)$, (iii) $f(m)=m$ if and only if $m=1$.