Function $f$ such that $f$ is non-periodic but $f(f(x))$ is?

238 Views Asked by At

Is there a "nice" example of a function $f$ such that $f(x)$ is non-periodic but the composition $f(f(x))$ is? By nice I mean that preferably it will be defined entirely on the domain $R$ and be continuous/differentiable with the composition having non-zero period.

For example the function $f(x>0)=-x, f(x \leq 0) = 0$ is not nice.

3

There are 3 best solutions below

4
On BEST ANSWER

A very simple example: $f(x)=\sin|x|$.

1
On

Let $a(x)$ be the sum of the binary digits of $\lfloor\,|x|\,\rfloor$. I think that is not periodic. $$f(x)=\sin^2(\pi x)(-1)^{a(x)}$$

0
On

One smooth function that works is $$ f(x)= \begin{cases} -\exp[-1/x] & x>0 \\ 0 & x \leq 0 \end{cases} $$ However, this doesn't give us a non-zero period.