Upon a slight rearrangement this problem gets a lot simpler to see.
x^3-x+2x^2-2=0 now factor 1st and 2nd pair of terms...
x(x^2-1)+2(x^2-1)=0
(x+2)(x^2-1)=0 now the second factor is a "difference of square" of the form:
(a^2-b^2) which always factors to (a+b)(a-b), in this case:
(x+2)(x+1)(x-1)=0
So g(x) has three real zero when x={-2, -1, 1}