Problem: Find all functions $f \colon \NN \to \NN$
which satisfy $f(a^2+b^2)=f(a)f(b)$ and
$f(a^2)=f(a)^2$ for all positive integers $a$ and $b$.

Solution: The answer is $f \equiv 1$ only, which works.
We prove it's the only one.

The bulk of the problem is:
\begin{claim*}
  If $f(a)=f(b)=1$ and $a>b$, then $f(a^2-b^2)=f(2ab)=1$.
\end{claim*}
\begin{proof}
  Write
  \begin{align*}
    1 = f(a)f(b) &= f(a^2+b^2) = \sqrt{f\left( (a^2+b^2)^2 \right)} \\
    &= \sqrt{f\left( (a^2-b^2)^2 + (2ab)^2 \right)} \\
    &= \sqrt{f(a^2-b^2) f(2ab)}. \qedhere
  \end{align*}
\end{proof}

By setting $a=b=1$ in the given statement
we get $f(1) = f(2) = 1$.
Now a simple induction on $n$ shows $f(n) = 1$:
\begin{itemize}
  \ii If $n = 2k$ take $(u,v) = (k,1)$ hence $2uv = n$.
  \ii If $n = 2k+1$ take $(u,v) = (k+1,k)$ hence $u^2-v^2=n$.
\end{itemize}