Hello.
To do this, we need to work from right to left. (Another way to phrase it is from inside to out).
Step by step:
1). f(x)= 3x+1
2). Take 3x+1 and plug it into wherever you see the variable x in the g(x).
** g(f(x))= (3x+1)² + 4(3x+1) +6
g(f(x))= (3x+1)² + 12x + 4 + 6
g(f(x))= (3x+1)² + 12x + 10
g(f(x))= (3x+1)(3x+1) + 12x + 10
g(f(x))= 9x² + 6x +1 + 12x +10
g(f(x))= 9x² + 18x + 11
Hope that helped.
** this is not proper notation, but rather, a demonstration of how plugging functions into functions would work.
************************
Disclaimer:
Always double check your answer with a reliable source, as mistakes can be made.