When dealing with functional notation, you plug in the value given for x in the original equation. In this case, you're just plugging the whole function g into f as x.
It will look like this...
If f(x) = 2x - 7 and g(x) = x^2 - 5x + 4 then,
(fog)(x) = 2(x^2 - 5x + 4) - 7
Notice all that's done here is that the whole function of g was substituted for x in the f function. Now, you just need to simplify by distributing 2 and collecting like terms.
(fog)(x) = 2x^2 - 10x + 8 - 7
Combine +8 and -7 to get:
(fog)(x) = 2x^2 - 10x + 1
This concept can go farther if you're given an ultimate value for x, but here you're just combining the functions.