# Does the equality $\lim_{x\rightarrow\infty} f(g(x)) = f(\lim_{x\rightarrow\infty} g(x))$ hold?

Does the equality $\lim_{x\rightarrow\infty} f(g(x)) = f(\lim_{x\rightarrow\infty} g(x))$ hold? If it is not always true, what is the condition that makes the equality hold?

-

If the $\lim_{x\to\infty}g(x)= a$ and $f(x)$ is continuous at $a$ then
$$\lim_{n\to\infty}f(g(x))=f(\lim_{n\to\infty}g(x))$$ holds
I don't know the necessary condition. But I know the sufficient condition. That is $f(x)$ need to be continuous.
Like for example $$\lim_{x\to\infty}e^{\frac{1}{x}}=e^{\lim_{x\to\infty}\frac{1}{x}}=e^0=1$$