Answer
$$
g(x)=\left|x^{2}-1\right| -\left|x^{2}-4\right|
$$
$$
\left|x^{2}-1\right|=\left\{\begin{array}{ll}{x^{2}-1} & {\text { if }|x| \geq 1} \\ {1-x^{2}} & {\text { if }|x|<1}\end{array} \text { and }\left|x^{2}-4\right|=\left\{\begin{array}{ll}{x^{2}-4} & {\text { if }|x| \geq 2} \\ {4-x^{2}} & {\text { if }|x|<2}\end{array}\right.\right.
$$
So for
$$
0 \leq|x|<1, g(x)=1-x^{2}-\left(4-x^{2}\right)=-3
$$
for
$$
1 \leq|x|<2, g(x)=x^{2}-1-\left(4-x^{2}\right)=2 x^{2}-5
$$
and for
$$
|x| \geq 2, g(x)=x^{2}-1-\left(x^{2}-4\right)=3
$$
Work Step by Step
$$
g(x)=\left|x^{2}-1\right| -\left|x^{2}-4\right|
$$
$$
\left|x^{2}-1\right|=\left\{\begin{array}{ll}{x^{2}-1} & {\text { if }|x| \geq 1} \\ {1-x^{2}} & {\text { if }|x|<1}\end{array} \text { and }\left|x^{2}-4\right|=\left\{\begin{array}{ll}{x^{2}-4} & {\text { if }|x| \geq 2} \\ {4-x^{2}} & {\text { if }|x|<2}\end{array}\right.\right.
$$
So for
$$
0 \leq|x|<1, g(x)=1-x^{2}-\left(4-x^{2}\right)=-3
$$
for
$$
1 \leq|x|<2, g(x)=x^{2}-1-\left(4-x^{2}\right)=2 x^{2}-5
$$
and for
$$
|x| \geq 2, g(x)=x^{2}-1-\left(x^{2}-4\right)=3
$$