Problem 5
With f(0)=0, setting a=0 and b=−n shows that every value f(n) is a perfect square. Replacing b by f(a)−b yields the auxiliary assertion (): f(b)+(f(a)−b)f(2a) is a square. Let S be the zero set. If S is unbounded above, fix n and choose k in S with k>f(n). Applying () at a=n,b=k makes (f(n)−k)f(2n) a square; its first factor is negative while the second is a square, so f(2n)=0. Thus all even values vanish and odd values may be arbitrary squares. If S is bounded above, choose a sufficiently large prime p and put n=(p+1)/2. Applying () at a=n,b=2n shows that f(2n)(f(n)−2n+1) is a square. Since f(2n) is nonzero, writing f(n)=u² gives u²−v²=p, hence u=n and f(n)=n². These n are unbounded. The square-gap argument applied to () with arbitrarily large such k gives f(2n) equal to either 0 or four times f(n); boundedness of S then gives f(2k)=4k² for large k. Finally (**) at a=k,b=n says that (2k²−n)²+f(n)−n² is a square for arbitrarily large k, forcing f(n)=n² for every n.