On wikipedia it says the following on the first chain rule proof:
$\lim_{x \to a} \frac{f(g(x)) - f(g(a))}{g(x) - g(a)} \cdot \frac{g(x) - g(a)}{x - a}$
When $g$ oscillates near $a$, then it might happen that no matter how close one gets to $a$, there is always an even closer $x$ such that $g(x)$ equals $g(a)$. For example, this happens for $g(x) = x^2sin(\frac 1 x)$ near the point $a = 0$. Whenever this happens, the above expression is undefined because it involves division by zero.
I can see that with the function $g(x) = x^2sin(\frac 1 x)$ when $x$ approaches 0 that the amplitude goes to 0 and the frequency goes to infinity, and also know that by the squeeze theorem $\lim_{x \to 0} g(x) = 0$, but $g(a)$ at $a=0$ is undefined, since $(0^2)sin(1/0)=undefined$, so how can $g(x) - g(a) = 0$ or $g(x)=g(a)$? If the statement is not true at the point 0, but only near the point 0 how can it be shown that $g(x)=g(a)$ at such a point?