Functions are just a kind of group, like a fancy version of parentheses. So, if functions show up in more complicated expressions, you evaluate them first.
Suppose and we want to evaluate . Since we start with functions, we first need to find . We can then plug that into our original expression and simplify: .
Suppose and we want to evaluate . In that case, we start inside the function by simplifying . Then, we can evaluate . Finally, we can plug that into our original expression to get the final answer: