MathLabs

Problem 3

Find all functions g:Z>0→Z>0g:\mathbb{Z}_{>0}\to\mathbb{Z}_{>0} such that (g(m)+n)(g(n)+m)\left(g(m)+n\right)\left(g(n)+m\right) is a perfect square for all m,n∈Z>0m,n\in\mathbb{Z}_{>0}.
Step 5 of 6: The signs cannot change
g(k+1)−g(k)=1 for all kg(k+1)-g(k)=1\text{ for all }k
Detailed analysis

Each difference g(k+1)−g(k)g(k+1)-g(k) is either 11 or −1-1. If two consecutive differences had opposite signs, then either g(k+2)=g(k)g(k+2)=g(k) or g(k+2)=g(k)g(k+2)=g(k), contradicting injectivity. Thus all differences have the same sign. They cannot all be −1-1, because then g(k)=g(1)−(k−1)g(k)=g(1)-(k-1) would eventually be nonpositive, contrary to g(k)∈Z>0g(k)\in\mathbb{Z}_{>0}. Hence g(k+1)−g(k)=1g(k+1)-g(k)=1 for every kk.