If $f(f(x))$ is linear, is $f(x)$ linear? If f(x) is closed on the set of natural numbers?

85 Views Asked by At

If I have a function defined on the natural numbers $\mathbb Z_{>0}$, does $f(f(x))=ax+b$ imply that $f(x)=rx+q$, where $a,b,r,q$ are naturals? This came to mind in the context of a different problem, but I don't know where to start.

1

There are 1 best solutions below

0
On

No: consider the function $f$ that swaps every odd natural number with its successor. Then $f\circ f=id$ but $f$ is not monotone.