It might help to think of functions as little machines or factories that take some input, do something to it, then give you the result. A function definition like h(x) = -2x + 5 tells us what our function, h, does to the input, x. Whatever is in the parentheses is the input. If you see h(4), that means we give 4 to our function h. h(4) = -2 * 4 + 5 = -8 + 5 = -3, so h(4) = -3.
What if you wanted a function that doubled a number? That could be f(x) = 2x. Does it work? Let's try x = 3. We know if you double 3 you get 6. Does f(3) = 6? f(3) = 2 * 3 = 6. So yes!
If you wanted a function that subtracted 3 from any number? That might be g(x) = x - 3.
The neat thing about functions is that they can work on numbers, variables, or even other functions. That's what your question is asking. If you understand that functions take input, do their thing, then give the result, then you might guess how to proceed.
f(x) = -x + 5 g(x) = 4x + 2
A. f(g(x))? This looks complicated, but it's asking what the function f does to the input g(x). That's why g(x) is in parentheses. We know what it does to x, or to a number by substituting. We just do the same with the whole function.
f(g(x)) = - g(x) + 5 = -(4x + 2) + 5 = -4x - 8 + 5 = -4x - 3
B. g(f(x)) is asking what? What does g(x) do to f(x) as input? Again, we substitute just like with the numbers.
g(f(x)) = 4 f(x) + 2 = 4 (-x + 5) + 2 = -4x + 20 + 2 = -4x + 22
When you run across functions and compositions of functions, just remember they are little machines and do their work one step at a time.
There's a little mistake in there (no offense to Robert, just a slip that happens to all of us), in Part A we find
f(g(x)) = -g(x)+5 = -(4x+2)+5 = -4x+3
A. f(g(x)) = -g(x)+5 = -(4x+2)+5 = -4x - 3
B. g(f(x)) = 4f(x)+2 = 4(-x+5)+2 = -4x + 22