Q:

Find all functions for $f:\Bbb{N}\to\Bbb{N}$ such that $f\left(m^2+f(n)\right)=f\left(m^2\right) +n$

I would have given my approach but i didnt get anywhere. I just substituted zeroes and got $f(f(n)) =n$ and I'm just lost. Any help would be appreciated

A:

Solution 1. assuming $0\in\mathbb{N}$
Note that $f$ is clearly injective, so if we substitute $n=0$ we find that $f(m^2+f(0))=f(m^2)$, from which we see that by injectivity that $f(0)=0$. Letting $m=0$ in the original equation, we see that $f$ is indeed an involution as OP found.
Then if we set $m=1$ and $n=f(n)$, we find that $f(n+1)=f(n)+f(1)$. A simple induction shows that $f(n)=nf(1)$ for all $n\in\mathbb{N}$, and so $f(n)=nc$ for some constant $c$.
Substituting this into our original equation, we find $c^2=1$, and after checking, we see that $f(x)=x$ is the only solution to the functional equation. ($c\in\mathbb{N}$, and so is not negative)
Solution 2. assuming $0\notin \mathbb{N}$ 
Note that when we put in $m=1$, we find that $$f(f(n)+1)=n+1\tag{1}$$ 
Setting $n=f(n)+1$ in $(1)$ shows that $$\begin{align*} f(f(f(n)+1)+1)&=f(n)+2 \\ \implies f(n+2)=f(n)+2 \tag{2}\end{align*}$$We now prove that $f(1)=1$. Suppose not, i.e. $f(1)=k$ for some integer $k>1$. Then $k-1\in\mathbb{N^+}$. So putting $n=k-1$ in $(2)$ shows that $f(k+1)=f(k-1)+2$. But if we put $n=1$ in $(1)$, we find that $$f(k+1)=f(f(1)+1)=2$$ which implies that $f(k-1)=0$, a contradiction. Hence $k=1\implies f(1)=1$. Hence $f(2)=2$, and a simple induction using $(2)$ shows that $f(n)=n$ for all $n\in\mathbb{N^+}$. 

