Given
##color(white)(XXX)f(color(blue)(x))=color(blue)(x)^2-1##
and
##color(white)(XXX)g(color(red)(x))=color(red)(x)+1##
Note that ##(f@g)(x)## can be written ##f(g(x))##
and that ##(g@f)(x)## can be written ##g(f(x))##
##(f@g)(x) = f(color(blue)(g(x))) = color(blue)(g(x))^2-1##
##color(white)(XXXXXX)=(color(blue)(x+1))^2-1##
##color(white)(XXXXXX)=x^2+2x##
Since this is defined for all Real values of ##x##
the of ##(f@g)(x)## is all Real values.
(although it wasn’t asked for the would be ##[-1+oo)##)
Similarly
##(g@f)(x)=g(color(red)(f(x)))+1##
##color(white)(XXXXXX)=g(color(red)(x^2-1))##
##color(white)(XXXXXX)=color(red)(x^2-1)+1##
##color(white)(XXXXXX)=x^2##
Again this is defined for all Real values of ##x##
so the Domain is all Real values.
(but the Range is ##[0+oo)##)