Let $g(u)=3u-u^3.$ Then show $g(u)$ is strictly on on $u\in[-1,1]$ and decreasing outside that intervals. Since $g(-1)=2, g(1)=2.$ This means that for each $x\in(-2,2)$ there is a unique $y\in (-1,1)$ so that $g(y)+x=0.$
We want a continuous function $f$ such that $g(f(x))=x$ and $f(0)=0.$
Show that continuity of $f$ and $f(0)=0$ and $g(f(x))=x$ means that $f(x)\in(-1,1)$ for $x\in(-2,2).$ (1)
Then show if $g(y)=x$ then $g(-y)+(-x)=0,$ and, since $y\in(-2,2),$ $-y\in (-2,2).$
The only hard part is $(1).$ If $f(x_0)=y<-1$ or $f(x_0)>1$ then the function $g(u)=u^2-3u$ takes duplicate values for some $u_1,u_2)$ between $f(0)=0$ and $f(x_0),$ and since the values must be in the image of $f,$ we must have $u_i=f(x_i)$ for some $x_1,x_2,$ by the intermediate value theorem. But if $g(f(x_1))=g(f(x_2)))$ then $$x_1=g(f(x_1))=-g(f(x_2))=x_2!.$$
So it is not possible for $g$ to take duplicate values in the range of $f.$
The more general result: If $g$ is continuous and, for some $a<b<c<d,$ $g$ strictly decreasing on $[a,b]$ and $[c,d]$ and strictly increasing on $[b,c]$ and there is a continuous $f$ with $g(f(x))=x,$ and $f(x_0)\in(b,c).$ then $f(x)\in [b,c]$ for all $x.$
This is also true, of course, if we swap “increasing” and “decreasing.”
We can make the domain of $f$ be $[g(b),g(c)]$ by defining:
$$f(x)=u\text{ where } u\in [b,c], f(u)=x$$
We know that $f$ is well-defined because $f$ is continuous and strictly increasing, so there must be a $u$ and it must be unique.
This must be our $f,$ because the intermediate value theorem and the fact that if $f$ has a range including $f(x_0)$ means, if the range had some point outside $[a,b],$ there would be a solution to $g(u_1)=g(u_2)=x_2$ for distinct values $u_i$ in the range of $f,$ which is not possible.