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 3 of 6: Prove the prime-modular rigidity claim
g(a)≡g(b)(modp)⟹a≡b(modp)g(a)\equiv g(b)\pmod p\Longrightarrow a\equiv b\pmod p
Detailed analysis

Fix a prime pp and positive integers a,ba,b with g(a)≡g(b)(modp)g(a)\equiv g(b)\pmod p. Choose a sufficiently large positive integer MM so that both vp(M+g(a))v_p(M+g(a)) and vp(M+g(b))v_p(M+g(b)) are odd; this can be done by choosing a suitable residue of MM modulo a high enough power of pp: if the two constants differ by at least two powers of pp (or are equal), both valuations can be made 11, while if they differ by exactly one power of pp, they can be made 11 and 33. Since P(M,a)=(g(M)+a)(g(a)+M)P(M,a)=(g(M)+a)(g(a)+M) is a square, the odd valuation of M+g(a)M+g(a) forces a+g(M)a+g(M) to have odd p-adic valuation, hence p∣a+g(M)p\mid a+g(M). The same argument with bb gives p∣b+g(M)p\mid b+g(M). Therefore a≡b(modp)a\equiv b\pmod p.