Let $\mathbb{N}=\{1,2,3, \ldots\}$ be the set of positive integers. Find all functions $f$, defined on $\mathbb{N}$ and taking values in $\mathbb{N}$, such that $(n-1)^{2}<f(n) f(f(n))<n^{2}+n$ for every positive integer $n$.
The only such function is $f(n)=n$.

Assume that $f$ satisfies the given condition. It will be shown by induction that $f(n)=n$ for all $n \in \mathbb{N}$. Substituting $n=1$ yields that $01$, then the intervals $\left((a-1)^{2}, a^{2}+a\right)$ and $\left((b-1)^{2}, b^{2}+b\right)$ are disjoint which implies that $f(a)$ and $f(b)$ cannot be equal.

Assuming $f(n) \geq n+1$, it follows that $f(f(n))<\frac{n^{2}+n}{f(n)} \leq n$. This implies that for some $a \leq n-1, f(a)=f(f(n))$ which is a contradiction since $|f(n)-a| \geq n+1-a \geq 2$. This completes the induction.

Method 3: Assuming $f(n) \geq n+1$, it follows that $f(f(n))<\frac{n^{2}+n}{f(n)} \leq n$ and $f(f(f(n)))=$ $f(f(n))$. This implies that $(f(n)-1)^{2}<f(f(n)) f(f(f(n)))=f(f(n))^{2}<f(n)^{2}+f(n)$ and therefore that $f(f(n))=f(n)$ since $f(n)^{2}$ is the unique square satisfying this constraint. This implies that $f(n) f(f(n))=f(n)^{2} \geq(n+1)^{2}$ which is a contradiction, completing the induction.