When does the square root of $f:\mathbb{N} \rightarrow \mathbb{N}$ exist?

215 Views Asked by At

Let $f:\mathbb{N} \rightarrow \mathbb{N}$. When does there exist a $g: \mathbb{N}\rightarrow \mathbb{N}$ such that $f(n)=g(g(n))$ for all $n$?. I don't think its always possible, for example $f(n)=n+1$, doesn't seem likely that $g$ exists. The problem could be easier if we say $f$ is injective. Then $g$ must be injective. I didn't find this problem anywhere so I don't have a reference, I just thought of it. Im hoping dealing with $\mathbb{N}$ will give a nice answer. The problem has a nice answer for invertible matrices.