Suppose you have 2 functions: f(x) = 3x2, g(x) = log3(x). These are arbitrary, any functions would work. Evaluate f(g(x)): let y = log3(x) ( = g(x) ), then f(g(x)) = f(y) = 3y2 = 3[log3(x)]2.
The part that people tend to find difficult is remembering what it means to apply a function. A simple subsitution makes this much easier. Whilst the above situation makes it seem easy, consider how much more confusing it could be if f(x) = [x7 + 9x5 + e5x + cos(x-1/3)]/[sin(ex/6) + 1729*x], and g(x) was something similarly complicated; a simple substitution can do wonders and will help prevent confusion.