It's pretty well known and easy to show that for a linear fractional function $f(x)=\frac{ax+b}{cx+d}$ to be an involution, ie. $f(f(x))=x$, then $a\cdot d=-1$ is a necessary and sufficient condition.
An example of a rational function which satisfies $f(f(f(x)))=x$ is $\frac{x-1}{x}$.
I was fooling around with a few of these types of questions with a friend, and we got stuck on $f(f(f(f(x))))=x$. Does there exist a solution $f(x)=\frac{g(x)}{h(x)}$ where $g(x), h(x) \in \mathbb{Z}[x]$, and $f(f(x))\neq x$.
So far we've discovered that $f$ is bijective, $F(x):=f(f(x))$ is an involution, and $f(x)=\frac{1+ix}{x+i}$ works if we loosen the requirement on integer/rational coefficients, as $f(f(x))=\frac{1}{x}$ in this case.
We highly suspect that if $g(x), h(x)$ exist, then they are degree 3 or above as $F(F(x))=\frac{ax+b}{cx-a}$ doesn't seem to be yielding any acceptable solutions (and degree 2 doesn't satisfy bijectivity).
Suppose $f$ is a Mobius transform of order $n> 1$.
Since we are in characteristic zero, $f$ can't be conjugate to a translation, and since $n > 1$ it can't be the identity, so $f$ must have two distinct fixed points in $\Bbb P^1(\Bbb C)$, and then the derivative of $f$ at those fixed points must be a primitive $n$th root of unity.
Moreover, the product of those derivative is always $1$, so the sum of the two derivatives has to be $2\cos(2k\pi/n)$ where $k$ is coprime with $n$ (this is in fact equivalent to $f$ having order $n$).
But, the sum of the derivatives at the fixed points is a rational expression in terms of the coefficients of the Mobius transform (it is a pretty big one, you should convince yourself this works because it is a symmetric algebraic expression in terms of the two fixed points, and those fixed points satisfy a degree $2$ equation whose coefficients are expressions in terms of the coefficients of $f$)
So if such an $f$ exists with coefficients in $K$, you must have $2\cos(2\pi/n) \in K$. If $K = \Bbb Q$ this implies $\Bbb Q(2\cos(2\pi/n)) = \Bbb Q$. Looking at the degree of those extensions you get $\phi(n) = 1$ or $2$, so $n=2,3$ or $4$
To make a suitable Mobius transform of order $4$, take for example the one whose fixed points are at $\pm i$ and where the derivative are $\pm i$ there.
Then letting $g(z) = (z-i)/(z+i)$, we must have that $g(f(g^{-1}))(z) = iz$ (after conjugating by $g$, its fixed points are $0$ and $\infty$ so it is a scaling).
Thus $f(z) = g^{-1}(ig(z)) = (1+z)/(1-z)$