Is it possible to define a function $f$ from positive real to positive real such that $f(f(x)) = {1 \over x}$ Is it possible to define a function $f$, from positive real to positive real such that $f(f(x)) = {1 \over x}$?
The motivation comes from $1990$ IMO problem $4$, which one step involves defining such a function over the positive rationals. In the countable rational space one can use the trick that divides numbers into two countable lists and map one to another using different functions.
A comment in the video of that problem suggests a new problem: whether the function can be extended to positive real numbers? Basically we need to find a way to partition the reals into two sets and have two functions mapping one set to another set in a bijective way and the composition of the two functions in either order will give ${1 \over x}$. My thought is this looks impossible but I cannot prove it.
 A: Given a function $f:\mathbb R_{>0}\to\mathbb R_{>0}$, define a function $g:\mathbb R\to \mathbb R$ by $g(x)=\log f(e^x)$. Then $f$ satisfies the functional equation $f(f(x))=\frac1x$ if and only if $g$ satisfies the functional equation $g(g(x))=-x$. The latter equation is treated in great detail here:
Find a real function $f:\mathbb{R}\to\mathbb{R}$ such that $f(f(x)) = -x$?
A: Note that $f^4(x)=x$ (the operation here is composition). Each element is part of a length-4 orbit, going $x\to y\to \frac1x\to \frac1y\to x$. Well, OK, there's one exception $f(1)=1$ with a length-1 orbit.
Now, intuitively, it shouldn't be too hard to split the positive reals into orbits like this. The trick is to do it explicitly.
We can send open intervals to open intervals smoothly. If we take four intervals this way, then we get three additional endpoints, one of which is $1$ - trouble. In order to resolve this, we'll actually need to use infinitely many intervals. Let's pick something convenient: intervals $(\frac1{n+1},\frac1n)$ and $(n,n+1)$ for integers $n$.
If $n$ is odd and $n<x<n+1$, let $f(x)=x+1$.
If $n$ is even and $n<x<n+1$, let $f(x)=\frac1{x-1}$.
If $n$ is odd and $\frac1{n+1}<x<\frac1n$, let $f(x)=\frac1{\frac1x+1}=\frac{x}{x+1}$.
If $n$ is even and $\frac1{n+1}<x<\frac1n$, let $f(x) = \frac1x - 1$.
These cycle the way we want; starting at some $x$ in $(n,n+1)$, we get $x+1$, $\frac1x$, and $\frac1{x+1}$ in sequence before returning to $x$.
That leaves the endpoints - integers and reciprocals of integers.
Let $f(1)=1$.
If $n$ is even, let $f(n)=n+1$.
If $n$ is odd and greater than $1$, let $f(n)=\frac1{n-1}$.
If $n$ is even, let $f(\frac1n)=\frac1{n+1}$.
If $n$ is odd and greater than $1$, let $f(\frac1n)=n-1$.
OK, we could have made those open intervals in the earlier definition half-open. Anyway, this is an explicit function defined for all positive $x$ that works.
A: It looks like it's possible. 
Let $f(1)=1$. Now pair up a number $a$ with another number $b$ such that $1>a,b>0$, let $$f(a)=b, f(b)=\frac1a, f(\frac1a)=\frac1b,f(\frac1b)=a$$ pair up all numbers between $0$ and $1$ finishes the problem.
