# How to solve $f(f(x)) = x$?

Seems simple enough, but I have no idea how one would get all solutions to this. Wolfram Alpha gives $5$ answers, the first $2$ of which I could get myself, but the following $3$ completely defeat me. • Such functions are known as involutions. In general, given an invertible function $g$, $f(x)=g^{-1}(-g(x))$ is an involution. – Workaholic Sep 22 '16 at 12:58
• This is simple indeed, only on an entirely different level. There is a great deal of solutions, not just mere 5 or 50. – Ivan Neretin Sep 22 '16 at 13:02
• At first I thought the question was how to solve $f(f(x) = x$ for $x$. Obviously that depends on $f$! Now I understand the question is how to solve $f \circ f = \text{Id}$ for $f$, which is definitely nontrivial. – Matthew Leingang Sep 22 '16 at 13:09
• interesting question (+1) – tired Sep 22 '16 at 13:10
• notice also that solutions one and two are special cases of the solution 3 – tired Sep 22 '16 at 13:12

## 1 Answer

If you want a continuous solution:

1. Draw a graph of $y=x$ (this is an auxiliary construction, you will erase it later).
2. Starting at any point on the graph, draw a freehand graph of a decreasing function.
3. Draw the reflection of that graph with respect to the line $y=x$.
4. Erase the line $y=x$. What remains is the graph of your function.

If you want just any solution:

1. Select two arbitrary non-intersecting equinumerous sets $A,B\in\mathbb R$. (They can be empty, or finite, or countably infinite, or uncountably infinite; that doesn't matter.)
2. Select any bijection $A\leftrightarrow B$.
3. For any $x\in A$, let $f(x)$ be the image of $x$ in $B$ under that bijection, and vice versa.
4. For any $x\in\mathbb R\setminus(A\cup B)$, let $f(x)=x$.