f(g(x)) = f(3x+2) = h(x)=9x^2+12x + 6
Note that (3x+2)^2 = 9x^2 + 12x + 4, which is almost, but not quite, equal to h(x).
Let's experiment. What if f(x) = x^2 + 2?
Then f(3x+2) = (3x+2)^2 + 2 = 9x^2 + 12x + 4 + 2 = 9x^2 + 12x + 6, which is the same as the given h(x).
Thus, f(x) is x^2 + 2.