Real function $f$ such that $f(f(x)) = x^3 - 3x^2 + 3x$ Does there exist a function $f:\mathbb{R} \to \mathbb{R}$ such that $f(f(x)) = x^3 - 3x^2 + 3x$?
Since $f(x) = f(y)$ implies $f(f(x)) = f(f(y))$ and so $(x-1)^3 - 1 = (y-1)^3 - 1$, i.e. $x=y$, we have that $f$ must be injective. In particular, $f(f(0)) = 0$ and $f(z) \neq 0$ for $z\neq f(0)$.
I was thinking to try to mimic a known nice construction for $f(f(x)) = ax$ for $a > 0$ - namely $f(x) = -x$ if $x\geq 0$ and $f(x) = -ax$ if $x<0$. But if we try to use it here e.g. like $f(x) = -x$ for $x\geq 0$ and $f(x) = -x(x^2+3x+3)$ since $g(x) = x^2 + 3x + 3$, even though positive, does not satisfy $g(x) = g(-x)$.
Any idea how to fix this or for perhaps some different construction? (If it is "easy to describe" it would be awesome, but I am open to any suggestions.) Any help appreciated!

Take the function
$$
f(x)=
\begin{cases}
(x-1)^{\sqrt 3}+1,\qquad x\geq 1,\\
1-(1-x)^{\sqrt 3},\qquad x< 1.
\end{cases}
$$
Then for $x\geq 1$ we have
$$ 
f(f(x))=\left((x-1)^{\sqrt 3}+1-1\right)^{\sqrt 3}+1=\left((x-1)^{\sqrt 3}\right)^{\sqrt 3}+1=(x-1)^3+1=x^3-3x^2+3x.
$$
If $x<1$ we get
$$ 
f(f(x))=1-\left(1-\left(1-(1-x)^{\sqrt 3}\right)\right)^{\sqrt 3}=1-\left((1-x)^{\sqrt 3}\right)^{\sqrt 3}=1-(1-x)^3=x^3-3x^2+3x.
$$
