By taking m=n=1, we find f(1)2+f(1)∣4, so f(1)=1. By taking m=1, we then obtain
1+f(n)∣(n+1)2
To minimize the number of divisors as much as possible, let's choose n=p−1 with p being a prime. Then 1+f(p−1)∣p2, so f(p−1) can only be p−1 or p2−1. In the latter case, by taking n=1 and m=p−1 in the initial equation, we get
1+(p2−1)2∣((p−1)2+1)2
Expanding this, it becomes p4−2p2+2⩽p4−4p3+6p2−8p+4, which is impossible for p large enough. Therefore, we get f(p−1)=p−1 for p a large enough prime.
Finally, let n∈N∗. For a large enough prime p, we have
(p−1)2+f(n)∣((p−1)2+n)2
We aim to put this in a more convenient form: we have (p−1)2≡−f(n)(mod(p−1)2+f(n)), so the last equation becomes
(p−1)2+f(n)∣((−f(n)+n)2
and this for any large enough prime p. The number (f(n)−n)2 thus has an infinite number of divisors, so f(n)=n.