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?