Answer :
Let's say that f(x) = ax^2 + bx + c
if f(g(x)) = 9x^2 + 6x + 7:
a(3x + 1)^2 + b(3x + 1) + c = 9x^2 + 6x + 7
9ax^2 + 6ax + a + 3bx + b + c = 9x^2 + 6x + 7
Comparing the two equations, we can see that a = 1, b = 0 and c = 6, therefor f(x) = x^2 + 6
if f(g(x)) = 9x^2 + 6x + 7:
a(3x + 1)^2 + b(3x + 1) + c = 9x^2 + 6x + 7
9ax^2 + 6ax + a + 3bx + b + c = 9x^2 + 6x + 7
Comparing the two equations, we can see that a = 1, b = 0 and c = 6, therefor f(x) = x^2 + 6