For real univariate polynomials $f, g$, $f \circ f \circ f = g \circ g \circ g \implies f = g$?

Proposition 1. Let $n,m\ge1$. Let $$\begin{align}p(x)&=x^n+a_1x^{n-1}+\ldots+a_n,\\\tilde p(x)&=x^n+\tilde a_1x^{n-1}+\ldots+\tilde a_n,\\ q(x)&=x^m+b_1x^{m-1}+\ldots +b_m,\\\tilde q(x)&=x^m+\tilde b_1x^{m-1}+\ldots +\tilde b_m\end{align}$$ be polonomials with $p\circ q=\tilde p\circ \tilde q$. Then $q-\tilde q$ is constant.

Proof. The behaviour near $\infty$ tells us about the higher coefficients of $q$. More precisely, we have $$\tag1p(q(z))=q(z)^n+ O(z^{nm-m})$$ so that we can read off the highest coefficients of $$q(z)^n=z^{nm}+c_1z^{nm-1}+c_2z^{nm-2}+\ldots$$ where $$c_k=nb_k+(\text{polynomial in }b_1,\ldots, b_{k-1}).$$ Now from $c_1,\ldots, c_{m-1}$, we can determine one by one the coefficients $b_1,\ldots, b_{m-1}$, and of course obtain the same result when we use the same method to obtain $\tilde b_1,\ldots,\tilde b_{m-1}$. $\square$

Note that we cannot expect more since in we can always replace $q(x)$ with $q(x)+\delta$ and $p(x)$ with $p(x-\delta)$.

Proposition 2. In the situation of proposition 1, assume additionally $a_1=\tilde a_1$. Then $q=\tilde q$.

Proof. We can strengthen $(1)$ to $$\tag2 p(q(z))=q(z)^n+a_1q(z)^{n-1}+O(z^{nm-2m}). $$ The coefficient of $z^{nm-m}$ is $$ a_1+nb_m+(\text{polynomial in }b_1,\ldots, b_{m-1})$$ and allows us to also determine $b_m$. $\square$.


Now assume that $f,g$ are univariate polynomials with $(f^{\circ r}=g^{\circ r}$ for some $r\ge 2$. Then from $\deg(f^{\circ r})=(\deg f)^r$ and same for $g$, we conclude $\deg f=\deg g=:m$. If $m=1$, we have $(x+c)^{\circ r}=x+rc$ and so $f=g$ is immediate. Assume therefore that $m\ge2$. Apply proposition 1 to $n:=m^{r-1}$, $p=f^{\circ (r-1)}$, $q=f$, $\tilde p=g^{\circ (r-1)}$, $\tilde q=g$, to find that $f-g=\text{const}$. In particular, we know enough of $f$ to use proposition 2 and conclude $f=g$.