This is a question from Calculus 7e by Stewart:

It's easy to prove by calculating the limit of $e^{ln(f(x))\cdot g(x)}$ if $f(x)$ is restricted to a positive function. However, seems that if we remove this restriction the conclusion still holds. But then we cannot use $ln(f(x))$ since $f(x)\leq 0$ is possible. So how to prove the general form of this limit?