# Rules for evaluating $\lim_{x \to a}f(g(x))$

I want to know about the rules of evaluating $\lim_{x \to a}f(g(x))$

Is it always equal to $f(\lim_{x\to a}g(x))$? When is it not equal to this? What are the specific cases?

Certainly, if $\lim_{x\to a} g(x)$ exists, and $f$ is continuous at $\lim_{x\to a} g(x)$, then the two expressions exist and are equal.
If $f$ is not continuous, even if both expressions exist, they may not be equal. For example \begin{align*} f(x) &= \begin{cases} 0 & \text{if } x \le 0 \\ 1 & \text{if } x > 0 \end{cases} \\ g(x) &= x^2 \\ a&= 0. \end{align*}
$\lim_{x \to a} f(g(x)) = f(\lim_{x \to a}g(x)) = f(m)$ ;
provided $f(x)$ is continuous at $x=m$.