How different can $f(g(x))$ and $g(f(x))$ be? Given $f,g: \mathbb{R} \rightarrow \mathbb{R}$, how "different" can $f(g(x))$ and $g(f(x))$ be?
By "how different" I mean: 
Given two real-valued functions $a,b$ do there exist two real-valued functions $f,g$ such that $f(g(x))=a(x)$ and $g(f(x))= b(x)$?
If not, is there some sens in which $f(g(x))$ and $g(f(x))$ can't be "too different"? 
 A: You can take the particular case both $a$, $b$ are bijective. If $f$, $g$ exist, they must also be bijective. But that means 
$$b = g (fg)g^{-1}=g a g^{-1}$$
that is, $b$ is conjugate to $a$.   Conversely, if 
$$b = g a g^{-1}$$ then $a = a g^{-1} g$ and $b= g(a g^{-1})$. 
So now you can investigate a similar problem: when two functions $a$, $b$ are conjugated under a bijection. This happens if and only if they oriented graphs given by these maps are isomorphic. If $a$, $b$ are bijections that means if and only if they have the same cycle structure. 
A: The functions $f$ and $g$ do not always exist.
Indeed, suppose that $a$ and $b$ are two bijections that have different orders in the group of all bijections from the set of real numbers to itself. Then, since $f \circ g=a$ and $g \circ f=b$ are bijective, so are $f$ and $g$. But then $a$ and $b$ would be conjugate, a contradiction since they have different orders and conjugate elements in any group always have the same order.
For example, consider the involution $x \mapsto -x$ and the map $x \mapsto x+1$. The former has order two, while the latter has infinite order. Also, there do not exist any two functions $f$ and $g$ for which $\forall x \in \mathbb{R}, (f(g(x))=-x) \land (g(f(x))=x+1)$, for we would then have $f(g(f(x)))$ equal to both $f(x+1)$ and $-f(x)$ for any real number $x$, and then $f(x+2)=-f(x+1)=-(-f(x))=f(x)$ and $g(f(x))=g(f(x+2))=x+3 \neq x+1$, a contradiction.
A: Given some function $h(x),$ let $f(x)$ be the function $h$ iterated $m$ times, and $g(x)$ be $h$ iterated $n$ times. So, these commute. 
This is how Irvine Noel Baker (1932-2001) modified the study of fractional iteration, the beginning is formal power series commuting with each other. 
