Find all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ such that for any natural number $n$,

$$
f(n)+f(f(n))+f(f(f(n)))=3 n
$$
Note that if $f(n)=f(m)$ then the equality remains true when composed by $f$, so $3 n=3 m$ hence $f$ is injective. Let's prove by strong induction on $n$ that $f(n)=n$. We initialize at $n=1$: we have $f(1), f(f(1)), f(f(f(1))) \in \mathbb{N}^{*}$ and their sum is 3, so $f(1)=1$. Suppose the rank $n, n \geq 1$. We have $f(n+1) \geq n+1$ by injectivity of $f$. Similarly, $f(f(n+1))$ and $f(f(f(n+1)))$ cannot be in $\{1, \cdots, n\}$. But

$$
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).