# What can be $f$ so that $f(f(x)) = -x$? [duplicate]

What can be $f$ so that $f^2(x) = -x$ for all $x\in R$?

I know that if $f^2(x) = -x$ then $f(x)$ is injective and $f$ can not be continuous.

But I can not find an example of discontinuous function so that $f^2(x) = -x$ for all $x\in R$.

Can anyone help me?

## marked as duplicate by Namaste, Mike Earnest, Omnomnomnom, user370967, MrYouMathOct 4 '17 at 15:56

• $f^2(x)=f\circ f(x)$ – Jorge Fernández Hidalgo Oct 4 '17 at 15:45
• First of all, clarify your notation. Presumably, $f^2(x) = f(f(x))$. Second, how do you know that $f$ cannot be continuous? Finally, what have you tried? – Omnomnomnom Oct 4 '17 at 15:46
Just look at the cycle representation of $f\circ f=-x$, there is one fixed element and a bunch of $2$-cycles, So to build a suitable permutation just pair up the $2$-cycles and for each $(a,b)$ and $(c,d)$ add the $4$-cycle $(a,c,b,d)$.
• In summary, if $A,B$ is a partition of the positive reals and $g:A\rightarrow B$ is a bijection then the permutation with cycles $(a,g(a),-a,-g(a))$ works. – Jorge Fernández Hidalgo Oct 4 '17 at 15:51