On AoPS, I found the problem:
Find all $f=\frac{ax+b}{cx+d}$ with $a,b,c,d\in\mathbb R$ which when iterated $n$ times gives the identity (group theoretic order $n$).
With some motivation to solve the above problem, I tried a slightly different problem.
If $f^n=\operatorname{Id}$ and $n$ is the smallest integer satisfying this property, find $(a+d)^2/(ad-bc)$.
Using lemma 6.1 of this paper, $f=g^{-1}hg$ for a mobius transform $g$ and a rotation $h$. So then let the matrix associated with $g$ be $S=\begin{bmatrix}w&x\\y&z\end{bmatrix}$, and for $h$ be $\Lambda=\begin{bmatrix}\alpha&0\\0&\beta\end{bmatrix}$, where $\beta=\overline\alpha$ for a $n$th root of unity $\alpha$ ($a,b,c,d$ are real). The matrix form of $g^{-1}$ is $\begin{bmatrix}z&-x\\-y&w\end{bmatrix}$, so the matrix form of $f$ is $$A=\begin{bmatrix}\alpha wz-\beta xy&(\alpha-\beta)xz\\-(\alpha-\beta)wy&-\alpha xy+\beta wz\end{bmatrix}.$$ At this point $(a+d)^2/(ad-bc)=(\alpha+\beta)^2/(\alpha\beta)$, so if $\alpha=e^{2\pi ik/n}$ with $\gcd(k,n)=1$, the answer is $4\cos^2\left(\frac{2\pi k}n\right)$.
The following questions: Is my above reasoning correct? Does the converse hold, that is, if $(a+d)^2/(ad-bc)=4\cos^2\left(\frac{2\pi k}n\right)$, must $f^n=\operatorname{Id}$? I have found similar questions on MSE, but none of the answers claim to have found all possible such $f$ (besides saying that all must be conjugate to a rotation, which for me I want to make explicit).
There might be an issue when instead of $\alpha$ and $\beta$ you have $1$ and $-1$, but I'm not sure how big of an issue that makes. The proof may also brake if $a,b,c,d\in\mathbb C$. I only have a high school math background with minimal exposure to more advanced stuff, so I'm not sure if I'm correct at all.