(Injectivity and Recurrence) Find all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ such that for every natural number $n$,

$$
f(n)+f(f(n))+f(f(f(n)))=3 n
$$
Note that if $f(\mathfrak{n})=f(\mathfrak{m})$ then the equality remains true when composed by $\mathrm{f}$, so $3 \mathrm{n}=3 \mathrm{~m}$ : $\mathrm{f}$ is therefore injective. Let us show by strong induction on $\mathrm{n}$ that $\mathrm{f}(\mathrm{n})=\mathrm{n}$. We initialize at $n=0$ : we have $f(0), f(f(0)), f(f(f(0))) \in \mathbb{N}$ and their sum is 0, so $f(0)=0$.

Suppose that $f(k)=k$ whenever $0 \leqslant k \leqslant n$. We have $f(n+1) \geqslant n+1$ by the injectivity of f. Similarly, $f(f(n+1))$ and $f(f(f(n+1)))$ cannot be in $\{1, \cdots, n\}$. Now,

$$
f(n+1)+f(f(n+1))+f(f(f(n+1)))=3(n+1),
$$

so $f(n+1)=n+1$ and this closes the induction. The identity is indeed the unique solution to the problem (it does indeed work).