Since f(x)=x−1, the given relation is:
g(x−1)=x3−x2+2x+3
To get g in terms of its own input, let t=x−1, so x=t+1.
g(t)=(t+1)3−(t+1)2+2(t+1)+3
Using (t+1)3=t3+3t2+3t+1 and (t+1)2=t2+2t+1:
g(t)=t3+3t2+3t+1−t2−2t−1+2t+2+3
=t3+2t2+3t+5
t is just a name for the input, so replacing t with x:
g(x)=x3+2x2+3x+5
Quick shortcut: at x=1, f(1)=0, so g(0)=3+2−1+1=5. Only x3+2x2+3x+5 gives 5 at x=0.