First we should know the general rule concerning the composition of functions
For example, fog(x)=f[g(x)] and gof(x)=g[f(x)]
a). f(g(1)) can be evaluated as follow: f(g(1)) =f[6]=5, because g(1)=6 and f(6)=5
b). g(f(1)) can be evaluated as follow: g(f(1))=g(3)=3 because f(1)=3 and g(3)=3
c). f(f(1)) can be evaluated as follow: f(f(1)) =f[3]=4, because f(1)=3 and f(3)=4
d). g(g(1)) can be evaluated as follow: g(g(1))=g(6)=3 because g(1)=6 and g(6)=3
e). (gof)(3) can be evaluated as follow: g(f(3))=g(4)=1 because f(3)=4 and g(4)=1
f). (gof)(6) can be evaluated as follow: g(f(6))=g(3)=2 because f(6)=3 and g(3)=2