The correct option is C g(x)=−2x−1
(f∘g)(x)=3x2+7x+1
f(g(x))=3x2+7x+1 ⋯(1)
Let g(x)=ax+b
So, f(g(x))=3(ax+b)2−5(ax+b)−1 ⋯(2)
Equating eqn (1) and eqn (2),
3x2+7x+1=3a2x2+(6ab−5a)x+3b2−5b−1
Comparing the coefficient
a=±1,b=2,−13
∴g(x)=x+2 and g(x)=−x−13