# Functional equation with commutativity

Let $f, g:\mathbb{N_0} \mapsto \mathbb{N_0}$ be such that

1. $f(1) >0, g(1)>0$
2. $f(g(n)) = g(f(n))$ $\forall n\in \mathbb{N_0}$
3. $f(m^2+g(n))=f(m)^2+g(n)$ $\forall m, n \in \mathbb{N_0}$
4. $g(m^2+f(n))=g(m)^2+f(n)$ $\forall m, n \in \mathbb{N_0}$

Prove that $f(n)=n$ $\forall n \in \mathbb{N_0}$

What have I done so far:

Plugging in $m=n=0$ and using $(3)$ and $(4)$, we see that $$f(g(0))=f(0)^2+g(0)$$ and $$g(f(0))=g(0)^2+f(0)$$ Now using the commutativity of the functions we see that $$g(0)^2+f(0)=f(0)^2+g(0)$$ The hint in the book I'm referring says to use this and conclude $2g(0)^2=g(g(0))^2$ and therefore $g(0)=0$. Similarly $f(0)=0$. Now this is the part where I'm confused at. Please explain how I should proceed in this step, as the other parts of the proof are clear to me.

The book I am using is Functional Equations: A Problem Solving Approach by B.J. Venkatachala.

Thank you.

Note that $$g(g(f(0)))=g(g(0)^2+f(0))=g(g(0))^2+f(0).$$ On the other hand, $$g(f(g(0)))=g(0^2+f(g(0)))=g(0)^2+f(g(0))=g(0)^2+g(f(0))=2g(0)^2+f(0).$$ Since $g$ and $f$ commute, these two expressions are actually equal, and so $g(g(0))^2=2g(0)^2$.
• Yeah, it wasn't easy to find! I actually was stumped and was just looking for a different way to prove $g(0)=0$ when I finally stumbled across it. Feb 14, 2018 at 2:18