Trouble understanding chain rule proof I'm having a little difficulty understanding my professor's proof of the chain rule. The theorem is given as: 
Assume $f:(a,b) \rightarrow (c,d)$ and f is differentiable at a point $x_0 \in (a,b)$ and that $g(c,d) \rightarrow \mathbb{R}$ is differentiable at $f(x_0)$. Then $g \circ f$ is differenatible at $x_0$ and $(g \circ f)'(x_0) = g'(f(x_0)) \cdot f'(x_0)$. 
The proof is as follows:

$\frac{ g \circ f(x) - g \circ f(x_0)}{x-x_0} = \frac{g(f(x)) -
 g(f(x_0)}{f(x) - f(x_0)} \cdot \frac{f(x)-f(x_0)}{x-x_0}$
Define $\phi = \begin{cases} \frac{g(y) - g(f(x_0))}{y-f(x_0)}, \text{
 if } y \neq f(x_0) \\ g'(f(x_0)) \text{ if } y = f(x_0)\\ \end{cases}
 $
Then $\phi$ is continuous at $f(x_0)$ by differentiation of g and
  $\phi \circ f$ is continuous at $x_0$ by continuity of $\phi$ at
   $f(x_0)$ and of f at $x_0$ (because f is differentiable). Furthermore:
$\frac{ g \circ f(x) - g \circ f(x_0)}{x-x_0} = \phi \circ f(x) \cdot
 \frac{f(x) - f(x_0)}{x-x_0}$
And so we can conclude that
$\lim \frac{ g \circ f(x) - g \circ f(x_0)}{x-x_0} = \lim \phi \circ
 f(x) \cdot \frac{f(x) - f(x_0)}{x-x_0} $ $= \phi \circ f(x) \cdot
 f'(x_0)$ $= g'(f(x_0)) f'(x_0)$

I'm really confused as to why we specifically chose that function for $\phi$. Also, why does continuity matter? Is it because by continuity, we know that limits are unique, which allows us to equalize the limits?
 A: \begin{align}
& (g\circ f)'(x_0) \\[10pt]
= {} & \lim_{x\to x_0} \frac{g(f(x)) - g(f(x_0))}{x-x_0} \\[10pt]
= {} & \lim_{x\to x_0} \frac{\Delta g(f(x))}{\Delta x} \\[10pt]
& \overset{\Large\text{???}} = \lim_{x\to x_0} \frac{\Delta g(f(x))}{\Delta f(x)} \cdot \frac{\Delta f(x)}{\Delta x} & & \text{The difficulty here is that $\Delta f(x)$ may be 0.} \\[10pt]
= {} & \lim_{x\to x_0} \frac{g(f(x)) - g(f(x_0))}{f(x) - f(x_0} \cdot \frac{f(x) - f(x_0)}{x-x_0} \\[10pt]
= {} & \lim_{x\to x_0} \frac{g(y) - g(y_0)}{y - y_0} \cdot \underbrace{ \frac{f(x) - f(x_0)}{x-x_0} }_{\begin{smallmatrix} \large\text{This clearly} \\  \large \text{approaches } f\,'(x_0). \end{smallmatrix}}
\end{align}
Does the first fraction, $\dfrac{g(y) - g(y_0)}{y-y_0},$ approach $g'(y) = g'(f(x_0))\text{?}$ It does if there are no problems of $0$ in the denominator, which would result in $0$ in the numerator as well. If we could say $y\to y_0$ and $y$ never equals $y_0$ as $x$ is approaching $x_0$, then we'd be done. The piecewise definition replaces that fraction, $\dfrac{g(y) - g(y_0)}{y-y_0},$ with its limit as $y\to y_0$ whenever $x$, in its approach to $x_0$, is at a point where $f(x) = y$ is equal to $y_0 = f(x_0).$
