Let $p$ be a prime, let $\mathbb K$ a field with $\operatorname{char}(\mathbb K)=p$ and $\mathbb{K}(x)$ be the field of fractions of the polynomial ring $\mathbb{K}[x]$, i.e. $$\mathbb{K}(x)=\left\{\frac{g(x)}{h(x)}:g,h \in\mathbb{K}[x], h\neq 0\right\}.$$
My central question is this:
How to characterize elements of order 3 in $\mathbb{K}(x)$, that is, rational functions $f\in \mathbb{K}(x)$ such that $f^3(x):=f\circ f\circ f(x)=x$? Are there explicit formulas for such $f$ and/or conditions that (the coefficients of) $f$ must satisfy?
Also, any input on elements of finite order $n> 3$ would be greatly appreciated!
What I found out so far: In the case of linear fractional transformations, we can write $$f(x) = \frac{ax+b}{x+d}, \qquad a,b,d\in \mathbb{K},$$ and from the condition that $f^3(x)=x$ we can explicitly derive $$b=-a^2-ad-d^2,$$ thus giving us a very clear picture of how these elements look like. Unfortunately, my approach (essentially consisting of symbolic calculations in Sage) becomes impractical for $\mathrm{deg}(g), \mathrm{deg}(h)>1$.
Also there is this paper by E. F. Allen that characterizes linear fractional transformations of any order, but it only applies to polynomials with real coefficients.