What is a condition for two real functions $f,g$ to "commute", so $f(g(x))=g(f(x))$? Say I'm given two functions $f,g$. Can I tell if they &quot;commute&quot; without actually trying them in the formula
$f(g(x))=g(f(x))$?
And given a function $f$, is there a way to find all functions $g$ such that
$f(g(x))=g(f(x))$?
I've tried using derivatives and the chain rule but haven't got anything interesting yet.
There is, in general, no characterization other than the evaluation of $f(g(x))$ and $g(f(x))$.
Also, for fixed $f$ there is no an easy way to find all the $g$ such that $f \circ g = g \circ f$.
Special cases can be studied. For example, a theorem of J. Lipiński says that if $f$ is a continuous and strictly monotonic function on an interval $I$ such that $f(I) \subseteq I$ then there is an infinity of solutions $g$ (depending on an arbitrary function).
If $f(x) = g^{-1}(x)$, then $f(g(x)) = g(f(x))$ but the converse is not true.
If $f(x) = g(x)$, then $f(g(x)) = g(f(x))$.