The definition

means that f always outputs 6, no matter the input. So, if you want to compute the composition

It means that you want to compute f giving as input the result of g(x):

But no matter the input:
is always 6! So, we have

for every possible x.