TITLE: Uniqueness in Composition of Polynomials
QUESTION [9 upvotes]: The following situation came up in my research:
Suppose two functions $f$ and $g$ map $[0,\infty)$ to (a subset of) itself. The function $f$ is linear and $g$ is quadratic, but $g$ is one-to-one on the interval $[0,\infty)$.
My conjecture/desired property: Any permutation of compositions of these two functions yields a unique polynomial.
The only progress I've made is the easy step of looking at degrees to argue that if two permutations are the same then they must have the same number of $g$'s.
For example, in my specific case $f(x)=x+1$ and $g(x)=x^2+x=x(x+1)$. Looking at length-3 compositions with two $g$'s gives the following different polynomials:
$f\circ g \circ g (x) = 1 + x + 2 x^2 + 2 x^3 + x^4$
$g\circ f \circ g (x) = 2 + 3 x + 4 x^2 + 2 x^3 + x^4$
$g\circ g \circ f (x) = 6 + 15 x + 14 x^2 + 6 x^3 + x^4$
I feel like this is probably easier than I'm making it, so please feel free to just give a reference for dealing with the semigroup(?) of polynomial composition.

REPLY [2 votes]: This is a bit more than what you want, but in MR1438634 (98c:12003), it is shown that 
f(x)=x+1 and g(x)=x^3 generate a free subgroup of the group of homeomorphisms of R. 
What you need is a semi-group and sometimes it is easier to find them. There is a bit more general discussion of this question and others in pages 30-31 and 37 of Topics in Geometric Group theory, by Pierre de la Harpe.