Explanation:
it's really simple.
g(f(x)) means that you use x to create f(x), and then you use this f(x) as argument in g(x).
with our functions here it means in general to use f(x) = 4 - x as argument (instead of purely x) in g(x).
g(f(x)) = 5×(4 - x) - 2 = 20 - 5x - 2 = 18 - 5x
that is the whole trick.
now, when we have a specific x value (x = 6 in our example here), it can be even simpler.
we need to "feed" 6 into f(x).
4 - x = 4 - 6 = -2
so, f(6) = -2
now this -2 becomes the argument for g(x).
5×(-2) - 2 = -10 - 2 = -12
so, g(f(6)) = -12
let's check for control and also use the functional definition of g(f(x)) we established above :
18 - 5×6 = 18 - 30 = -12
the same result, so all correct.