We know that if we suppose $g$ and $f$ are functions that
$$\lim _{x\to a}g(x)=L,\quad \lim _{x\to L}f(x)=A$$
and $g(x)\ne L$ in neighborhood blacked out at $a$, so we can say that $$\lim _{x\to a}f(g(x))=A.$$
I have a question: If we delete assumption "$g(x)\ne L$ in neighborhood blacked out at $a$", then why this mathematical theorem is wrong?