Let $K$ be a field (not necessarily infinite) and $K(x)$ be the field of rational functions in the variable $x$.
Let $g(x)$ and $h(x)$ be in $K(x)$. For fixed degrees, and "generically", I would have that $L=K(g(x),h(x))=K(x)$. This does not happen exactly all the times in which I have that both functions live in some $K(s(x))$ (by Luroth theorem).
I am interested in an algorithm or an (easy to apply) sufficient criterion on $g,h$ to obtain necessarily $L=K(x)$. Notice that one should restrict to the case of non-coprime degrees for $g,h$, otherwise the problem is trivial by tower law