Find all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ such that:

$$
f(n)+f(f(n))+f(f(f(n)))=3 n
$$
We notice that the identity is a solution. Let's show that it is the only one.

Firstly, $f$ is injective: $f(a)=f(b) \Longrightarrow f(f(a))=f(f(b)) \Longrightarrow f(f(f(a)))=$ $f(f(f(b)))$. Therefore, $3a=3b$ so $a=b$.

For $n=0$, since $f(k) \geq 0$ we get $f(0)=0$. Let's prove by strong induction on $n$ that $f(n)=n$. Indeed, if it is true up to rank $n \geq 0$, since $f$ is injective, $f(k) \geq n+1$ if $k \geq n+1$. Therefore, $f(n+1) \geq n+1$ so $f(f(n+1)) \geq n+1$ so $f(f(f(n+1))) \geq n+1$. Hence, $f(n+1)=3(n+1)-f(f(n+1))-f(f(f(n+1))) \leq n+1$. Therefore, $f(n+1)=n+1$. Hence the result.