(Base on the solution of Hadi Alaithan, IMO 2023's team member)
Note that for x,y are coprime positive integers, we have
x−y∣xf(x)−yf(y)⇔x−y∣x∣f(x)−f(y)∣−1.
Now we state the following lemma:
Lemma (Zsigmondy's Theorem): for a>b≥1 be coprime integers and n≥2, there exists a prime divisor of an−bn that does not divide ak−bk for all 1≤k<n, except when n=2 and a+b is a power of 2 or (a,b,n)=(2,1,6).
Back to the original problem, for any coprime integers x and y, we show that ∣f(x)−f(y)∣≤1. Suppose that the difference is larger than 1, then there exists a prime p divides f(x)−f(y). Because x and y are relatively prime, one of these numbers is not a multiple of p. Assume that gcd(x,p)=1. By choosing a suitable number z, we will show that this is a contradiction.
Denote k=vp(f(x)−f(y)). By the lemma, for some N1>k, there exists a prime q1 such that
ordq1(x)=pN1,q1>xy.
Similarly, for some N2>N1>k such that there exists a prime q2>q1 and
ordq2(y)=pN2
It is obvious that q1,q2,x and y are pairwise relatively prime. By Chinese remainder theorem, there exists a positive integer z such that
{z≡1(modx),z≡1(mody),z≡x(modq1),z≡y(modq2).
These conditions give
{q1∣(z−x)∣x∣f(z)−f(x)∣−1q2∣(z−y)∣y∣f(z)−f(y)∣−1.
Hence pN1∣f(x)−f(z) and pN2∣f(x)−f(y). These give pN1∣f(x)−f(y). This is a contradiction.
Now, we show that f(x)=f(y) for all coprime x,y>1. Choose z>2x,2y such that gcd(z,xy)=1. Then we have
z−x>x−1,z−y>y−1.
Then both f(z)−f(x)=0 and f(z)−f(y)=0 due to the divisibility. We obtain that f(x)=f(y) if x and y are relatively prime.
In conclusion, f is constant on {2,3,…} and f(1)∈N.