It is not always true that if the limit of f(x) as x->a is b and the limit of g(y) as y->b is c, then the limit of g(f(x)) as x->a is c. However, there are two common situations where this will be true. For instance, if f is one-to-one (injective) on an open interval containing a, then the preceding fact is true -- this is the idea behind using change of variables to simplify limits. Alternatively, if the limit of f(x) as x->a is b and g(y) is continuous at y=b, then the limit of g(f(x)) as x->a is c. While this may seem like a handful, it should help to see some examples of the idea in action.