Solve the composition $f \circ g=?$ and $g\circ f=?$ a) $f(x) =  \sqrt[3]{x}\ $ and $g(x) = x^3$
find $f\circ g=?$ and $g\circ f=?$
I have $f\circ g = f(g(x)) = f(x^3) =  \sqrt[3]{x^3}  = x$
So basically, first we replace $g(x)$ with its value, then we replace $x$ with the value of $f(x)$ inside $g(x)$?
$g\circ f = g(f(x)) = g( \sqrt[3]{x} ) =  \sqrt[3]{x^3} $ OR $ \sqrt[3]{x}^3 $ ?
b) $f(x) = \sin x$ and $g(x) = x^2$
$$(f\circ g) = f(g(x)) = f(x^2) = \sin (x^2)$$
$$(g\circ f) = g(f(x)) = g(\sin x) = (\sin x)^2 = \sin^2x$$
Am I doing it right? I'm kinda confused whether I have to replace x with the original value or not.
 A: Yes, you are doing the function compositions correctly. In the first case, since you had doubt on how to write $g\circ f$:
$$g\circ f = g(f(x)) = g(\sqrt[3] x) = \left(\sqrt[3] x\right)^3 = x$$
So, indeed, in the first case, we have $(f\circ g)(x) = (g \circ f)(x) = x$: by definition then, $g(x) = f^{-1}(x)$: $f$ and $g$ are called "inverses" of one another.
Very often, though, as you see in your second pair of functions, $f\circ g \neq g\circ f$.
A: One important remark on notation: $f$ is a function, $f(x)$ is this function applied to $x$, they are not the same thing, no $=$ should ever be between them. The same goes for $f\circ g$. You should not write $f\circ g=f(g(x))$. Where does the $x$ come from? Instead write
$$(f\circ g)(x)=f(g(x))=f(x^3)=\sqrt[3]{x^3}=x,\text{ and hence }f\circ g=\mathrm{id}.$$
You can leave off the last part if that is not notation that you have used. Just as well you could write
$$(f\circ g)(x)=f(g(x))=\sqrt[3]{g(x)}=\sqrt[3]{x^3}=x.$$
That these yield the same result should give us some confidence in the notation.
Also note that the domains and codomains of the functions should be given. Is $\sqrt[3]{x}$ defined for $x<0$?
Lastly, not everyone agrees with me on this, but I would recommend not to leave off the parentheses in $(f\circ g)(x)$. Indeed, I would read $f\circ g(x)$ as $f\circ(g(x))$ (which does not make sense here). So be on the safe side and write $(f\circ g)(x)$. 
A: so there is two different case and different result,for example let us suppose that
$f(x)=x^3$
and $g(x)=x^2$
then multiplication  is directly $x^3*x^2=x^5$
for composition like $f\circ g=f(g(x))=(x^2)^3$
$g\circ f=g(f(x))=(x^3)^2$
