Why is this proof of 1D the Chain Rule wrong? This proof of the one dimensional chain rule was pointed out as inaccurate (if not utterly wrong) by our calculus teacher a couple years ago: denoting the composition as $f(g(x))=(f\circ g)(x)=f(y)$ where $y\doteq g(x)$, 
$$\frac{\mathrm{d}f(g(x))}{\mathrm{d}x}\Big|_{x=x_0}=
\lim_{x\to x_0}\frac{f(g(x))-f(g(x_0))}{x-x_0}=
\lim_{x\to x_0}\frac{f(g(x))-f(g(x_0))}{g(x)-g(x_0)}\cdot\frac{g(x)-g(x_0)}{x-x_0}=
\frac{\mathrm{d}f(y)}{\mathrm{d}y}\Big|_{y=g(x_0)} \frac{\mathrm{d}g(x)}{\mathrm{d}x}\Big|_{x=x_0}.
$$
The reason of this remark was, of course, the possibility of dividing by zero in the second passage, given for example by a constant $g(x)$.
Is there really no way of making this statement rigorous, e.g. by sorting the possible pathological cases and so on?
 A: The problem is that you do not know if $g(x_0) - g(x)$ is different from $0$ for all values of $x\neq x_0$.
Another problem is that you have no proof that 
$$\lim_{x\to x_0}\frac{f(g(x))-f(g(x_0))}{g(x)-g(x_0)} = \lim_{y\to y_0}\frac{f(y)-f(y_0)}{y-y_0}$$
This equality is true for the functions you have, however, it is not trivial. Therefore, unless you prove it or justify it by some other result, you cannot simpliy claim to know it.
A: It turns out the answer is "yes" and the trick is shown on the very wikipedia page on the subject.
Let:
$$
Q(y)= \left\{
    \begin{array}{rl}
      \frac{f(y)-f(g(x_0))}{y-g(x_0)} & \text{if } y\not= g(x_0),\\
      \frac{\mathrm{d}f}{\mathrm{d}y}\Big|_{y=g(x_0)} & \text{if } y= g(x_0).
    \end{array} \right.
$$
Now the difference quotient trivially satisfies the following identity:
$$
\frac{f(g(x))-f(g(x_0))}{x-x_0}=Q(y)\cdot \frac{g(x)-g(x_0)}{x-x_0}.
$$
To conclude:
$$
\lim_{x\to x_0}\frac{f(g(x))-f(g(x_0))}{x-x_0} = \lim_{x\to x_0} Q(y)\cdot \frac{g(x)-g(x_0)}{x-x_0} =_{\text{if they exist}}\lim_{y\to g(x_0)}Q(y) \lim_{x\to x_0}\frac{g(x)-g(x_0)}{x-x_0} = \frac{\mathrm{d}f(g(x_0))}{\mathrm{d}y}\frac{\mathrm{d}g(x_0)}{\mathrm{d}x}.
$$
