Remark. Dear voters, this question is not a duplicate of the following old question. Please refrain from closing it for being a duplicate.
QUESTION: Find all functions $f:\Bbb{N}→\Bbb{N}$ which satisfy $$f(m^2+n^2)=f(m)^2+f(n)^2\,,\forall\space m,n\in\Bbb{N}\,.$$ Here, $\mathbb{N}=\{1,2,3,\ldots\}$.
MY APPROACH: Set $m=n$.. we obtain- $$f(2n^2)=2f(n)^2$$ Studying this equation I found out that $f(x)=\sqrt{\frac{x}2}$ satisfies the condition. But I could not think any further. If my claim is true, how do I prove it? And how do I make sure that there aren't any other functions satisfying the property?
Thank you for your help in advance :)
The only such function is $f(n)=n$.
The hard part is to show $f(1)=1$. After that, one just follows the answer to Find all $f$ such that $f\left(m^{2}+n^{2}\right)=f(m)^{2}+f(n)^{2},$ plus some small values of $f(n)=n$ that will be proved below.
Let $f(1)=a$.
The given formula applies directly to any number that is the sum of two squares. Thus \begin{align*} f(2)&=f(1+1)=2a^2\\ f(5)&=f(4+1)=(2a^2)^2+a^2=4a^4+a^2\\ f(8)&=f(4+4)=8a^4\\ f(10)&=f(9+1)=f(3)^2+a^2\\ f(13)&=f(9+4)=f(3)^2+4a^4 \end{align*}
However, some numbers are the sum of two squares in more than one way, and this is the key to the proof.
\begin{align} 7^2+1&=5^2+5^2,&f(7)^2&=2f(5)^2-a^2\\ 2^2+11^2&=5^2+10^2,&f(11)^2&=f(10)^2+f(5)^2-f(2)^2\\ 11^2+7^2&=13^2+1,&f(11)^2&=f(13)^2-f(7)^2+a^2\\ \hline 5^2+14^2&=10^2+11^2,&f(14)^2&=f(10)^2+f(11)^2-f(5)^2\\ 6^2+13^2&=3^2+14^2,&f(6)^2&=f(14)^2+f(3)^2-f(13)^2\\ \end{align}
The first three equations involve the variables $f(3)^2$, $f(7)^2$, $f(11)^2$. Eliminating $f(11)^2$ and $f(7)^2$ gives $$a^2 (4 a^2-1)f(3)^2 = a^2 (2a^2+1)^2(4a^2-1)$$ so $f(3)=2a^2+1$.
We can now use the last two equations to find $f(14)^2$, then $$f(6)^2=2(1+8a^2+17a^4+8a^6-16a^8)$$ This forces $a=1$ since the polynomial takes negative values for $a>1$.
It then follows that $f(n)=n$ for small values of $n$, by substitution, and hence by induction.