The correct option is B [−π4,π4]
g(f(x))=(sinx+cosx)2−1=sin2x which is invertible in [−π4,π4] because only in this domain the function is one one and onto. When we go out of this domain the function starts repeating itself, and hence more than one poins in co domain will have same pre-image in the domain