Find all $f: \mathbb{N}^{*} \rightarrow \mathbb{N}^{*}$ such that $\forall m, n \in \mathbb{N}^{*}$,

$$
f\left(m^{2}+f(n)\right)=f(m)^{2}+n
$$
Firstly, $f$ is injective: $f(a)=f(b) \Longrightarrow f\left(m^{2}+f(a)\right)=f\left(m^{2}+\right.$ $f(b)) \Longrightarrow f(m)^{2}+a=f(m)^{2}+b \Longrightarrow a=b$.

Next, we set $n=f(a)+b^{2}$ in the initial equation, and we get: $f\left(m^{2}+f(b)^{2}+a\right)=f(m)^{2}+$ $f(a)+b^{2}$. We symmetrize the right-hand side: we set $b=f(c)$ and we get $f\left(m^{2}+f(f(c))^{2}+a\right)=$ $f(m)^{2}+f(a)+f(c)^{2}=f\left(c^{2}+f(f(m))^{2}+a\right)$, so by injectivity $f(f(m))^{2}=m^{2}+k$ where $k \in \mathbb{Z}$ is a constant. This implies that for all $m, m^{2}+k$ is a square, so $k=0$. Therefore, $f(f(n))=n$.

Finally, we have $f(n+1)=f\left(f(f(n))+1^{2}\right)=f(n)+f(1)^{2}=n+a$ where $a=f(1)^{2}$. Thus, $f$ is affine and conversely we obtain $f=I d$.