Given the function $f(x) = x^2$ with the domain $[0, \infty)$ and $g(x) = \sin(x)$ with domain $(- \infty, \infty)$. What are the domain and range of $f(g(x))$ and $(g(f(x))$?
I start the problem by finding both $f(g(x))$ and $g(f(x))$. It appears that:
$g(f(x)) = \sin(x^2)$ and $f(g(x)) = (\sin(x))^2$
First, I consider the composition function $f(g(x))$:
We know that $Dom(g)$ is given by $(- \infty, \infty)$, and the $Ran(g)$ is $ [-1,1].$ We also know that $Dom(f)$ is given by $[0,\infty)$, and $Ran(f) = [0,\infty)$.
I realize that $Ran(g)$ is not a subset of $Dom(f)$. So, this does not exist (?)
For the second one, I realize that $Ran(f) \subset Dom(g),$ hence, the domain for $g(f(x)) = [0,\infty)$. Since $\sin(x)$ oscillates, then the range for $g(f(x)) = [-1,1]$.
Am i right? Thank you in advance.

This answer, unlike my previous answer, assumes that $f(x)=x^2$ is the restricted function with domain $[0,\infty)$.
You are right about $g(f(x))$: the domain is $\mathbb R=(-\infty,\infty)$ and its range is $[-1,1]$.
As for $f(g(x))$, it is defined whenever $g(x)\ge 0$, so in contrast with what you wrote it does sometimes exist. Since $g(x)=\sin(x)$ the condition holds when $x$ is in the first or second quadrant, i.e. for $x\in[2k\pi,(2k+1)\pi]$ for some $k\in\mathbb Z$, or we could say for $\operatorname{frac}\left(\frac x{2\pi}\right)\le\frac 12$.
This restricted domain does not change the range of $f(g(x))$ since for every $x$ where $\sin(x)<0$ we can use $-x$ where $f(g(x))$ is defined and the values are equal. So the range of $f(g(x))$ is $[0,1]$, just as for the unrestricted $f$.