# what function fulfills these conditions? [duplicate]

So I know that if $f(x) = x^{-1}$, than $f(f(x)) = x$ but $f(x)$ is not necessarily $x$. So now, is there $g(x)$ such that $g(g(x)) \neq g(x) \neq x$ but $g(g(g(x))) = x$? If so what is it, else why not?

• A real-valued example is $f(x) = \frac 1{1-x}$, which has the required property for all $x$ except $0$ and $1$. – MJD Mar 3 '15 at 2:55

If you allow $g\colon \mathbb{C}\to\mathbb{C}$, then $g(z)=ze^{\frac{2pi i}{3}}$, a counter-clockwise rotation by $2\pi/3$ in the complex plane, satisfies your conditions. In that case $g(g(g(z)))=z$, but $g(g(z))\neq g(z)\neq z$ for $z\neq 0$.

This construction works for other values as well:

• $f_2(z)=ze^{\frac{2\pi i}{2}}=-z$ is a rotation by $\pi$ with $f(f(z))=z$.
• $f_4(z)=ze^{\frac{2\pi i}{4}}=iz$ is a rotation by $\pi/2$ with $f(f(f(f(z))))=z$.
• $f_5(z)=ze^{\frac{2\pi i}{5}}$ is a rotation by $2\pi/5$ with $f(f(f(f(f(z)))))=z$.
• etc.

It's worth mentioning that the listed functions aren't the only possibilities. For example, $f_4(z)=-iz$ would have worked just as well, and you already gave a different example of $f_2$ in your question.

Think about rotation about the origin by $120$ degrees. In the complex plane, consider $f$ defined by $f(z) = z e^{\frac{2\pi}{3}i}$. Then, clearly, $f^2(z)$, $f(z)$, and $z$ are all distinct, unless $z \neq 0$. However, $f^3(z) = z e^{2\pi i} = z$.

• Sigh, I knew there was something obvious staring me in the face. – tox123 Mar 3 '15 at 2:06

In general if you are considering linear functions from $\mathbb{R}^d$ to $\mathbb{R}^d$ which are diagonalizable, then if your linear transformation matrix is represented as $MDM^{-1}$ where $D$ is the diagonal matrix of eigenvalues, then your matrix will satisfy your constraints as long as $D$ has all third roots of unity some of which are not $0, \pm 1$.

• I got to "are considering linear functions from" before I couldn't under stand anything. – tox123 Mar 3 '15 at 2:33