4. Determine all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ that satisfy the condition:

$$
x + \sqrt{x} - f(x) = \sqrt{f(f(x))}, \quad \forall x \in \mathbb{N}
$$

Gabriel Daniilescu, Brăila
Solution. First, we prove that f is injective

$\mathrm{f}(\mathrm{x})=\mathrm{f}(\mathrm{y}) \Rightarrow \mathrm{f}(\mathrm{f}(\mathrm{x}))=\mathrm{f}(\mathrm{f}(\mathrm{y})) \Rightarrow \mathrm{x}+\sqrt{x}=\mathrm{y}+\sqrt{y} \Rightarrow \mathrm{x}=\mathrm{y} \Rightarrow \mathrm{f}$ is injective

For $\mathrm{x}=0 \Rightarrow-\mathrm{f}(0)=\sqrt{f(f(0))} \Rightarrow \mathrm{f}(0)=0$

For $\mathrm{x}=1 \Rightarrow 2-\mathrm{f}(1)=\sqrt{f(f(1))} \Rightarrow 2-\mathrm{f}(1) \geq 0 \Rightarrow \mathrm{f}(1) \leq 2$ and since $\mathrm{f}(1) \neq \mathrm{f}(0) \Rightarrow \mathrm{f}(1) \in\{1,2\}$.

If $\mathrm{f}(1)=2 \Rightarrow \sqrt{f(f(1))}=0 \Rightarrow \mathrm{f}(2)=0 \Rightarrow \mathrm{f}(2)=\mathrm{f}(0) \Rightarrow 2=0$, false. Therefore, $\mathrm{f}(1)=1$ which satisfies the hypothesis.

We will prove by induction that $\mathrm{f}(\mathrm{n})=\mathrm{n}, \forall \mathrm{n} \in \mathbb{N}$.

We have $f(0)=0$ and assume that $f(0)=0, f(1)=1, f(2)=2, \ldots, f(n)=n$.

From injectivity, it follows that $\mathrm{f}(\mathrm{n}+1) \geq \mathrm{n}+1$. If $\mathrm{f}(\mathrm{n}+1)>\mathrm{n}+1 \Rightarrow \mathrm{f}(\mathrm{f}(\mathrm{n}+1)) \geq \mathrm{n}+1 \Rightarrow$

$\Rightarrow \mathrm{n}+1+\sqrt{n+1}=\mathrm{f}(\mathrm{n}+1)+\sqrt{f(f(n+1))}>\mathrm{n}+1+\sqrt{n+1}$, false!

It follows that $f(n+1)=n+1$ and by the method of mathematical induction, it follows that $\mathrm{f}(\mathrm{n})=\mathrm{n}, \forall \mathrm{n} \in \mathbb{N}$.