If $(f\circ g) (x)=(\sin\sqrt{x})^2$ and $(g\circ f) (x)=\lvert\sin x\rvert$, find $f$ and $g$.
My progress:
By trial and error I got one such pair $f(x) = \sin^2x$, $g(x)=\sqrt{x}$. But I can’t conclude that this is the only such pair or whether there exist other such pairs.
A different, more abstract approach:
Note that the given formulas make sense only if $x\ge0$. Note also that the functions $\Phi(x)=\sin^2(\sqrt x\,)$ and $\Psi(x)=\sin x$ are given as conjugate, via the function $\alpha(x)=x^2$, that is, $\Phi=\alpha\circ\Psi\circ\alpha^{-1}$. The functions you found were $f=\alpha\circ\Psi$ and $g=\alpha^{-1}$. Then $f\circ g=\alpha\circ\Psi\circ\alpha^{-1}=\Phi$, and $g\circ f=\alpha^{-1}\circ\alpha\circ\Psi=\Psi$.
Clearly, then, we may replace our $\alpha$ by $\bar\alpha=\alpha\circ\psi$ for any $\psi$ commuting with $\Psi$, for then $\bar f=\bar\alpha\circ\Psi$ and $\bar g={\bar\alpha}^{-1}$ will have $\bar f\circ\bar g=\alpha\circ\psi\circ\Psi\circ\psi^{-1}\circ\alpha^{-1}=\Phi$ and $\bar g\circ\bar f=\psi^{-1}\circ\alpha^{-1}\circ\alpha\circ\psi\circ\Psi=\Psi$.
The functions commuting with $\sin$ are rare, but among them are $\sin$ and $\arcsin$, so we have:
Example 1: $f=\sin^2(\sin(x))$, $g=(\alpha\circ\sin)^{-1}=\arcsin(\sqrt x\,)$.
Example 2: $f=x^2$, $g=\sin(\sqrt x\,)$. This is the answer we all should have seen, but it took me a lot of work.
Of course you can use $\psi=\sin^{\circ n}$, where that means iterating the sine $n$ times, or the $(-n)$-fold iteration of $\arcsin$ if $n$ is negative, giving another, different infinite family of solutions.