I am looking at the first proof of the chain rule on Wikipedia:
https://en.wikipedia.org/wiki/Chain_rule#First_proof
In the body of the proof, you will see that the author has defined a function $Q(y)$ = \begin{cases} \frac{f(y) - f(g(a))}{y - g(a)}, & y \neq g(a), \\ f'(g(a)), & y = g(a). \end{cases}
so that we can rewrite the difference quotient for $f(g(x))$ as
$$Q(y)\ {[g(x) - g(a)]\over(x - a)}$$
and avoid dividing by zero in our proof of the chain rule. $Q(y)$ is then evaluated at $g(x)$ and has its limit taken as $x \to a$ in the final step of the proof.
Here's the problem: It seems to me both that
(i) $Q(g(x))\ \bullet \ {[g(x) - g(a)]\over(x - a)}$ will always be equal to the difference quotient for $f(g(x))$ regardless of what value we assign to it in the case that $y = g(a)$, given that both expressions will evaluate to 0, and
(ii) the limit of $Q(g(x))$ will always evaluate to $f'(g(a))$ as $x \to a$, since $\lim_{x\to a}$$f(g(x)) - f(g(a)) \over g(x) - g(a)$ = $f'(g(a))$.
As a result, I don't see the harm in choosing any arbitrary value for $Q(y)$ when $y = g(a)$ - it seems that $Q$ doesn't actually need to be a continuous function for the proof to work. Intuitively, I feel that there must be something wrong with statement (ii), but I can't place a finger on precisely what the issue is. Hoping I can get some help on this and understand if/why $Q(g(x))$ has to be a continuous function for this proof to work.
It may be possible that there is a sequence $(x_n)_x$ such that $x_n \to a, x_n>a$ for all $n$ but $g(x_n)=g(a)$ for all $n$. So, (ii) does not hold: We then have $$ Q(g(x_n)) = Q(g(a)) = \text{the value we set for the case $y=g(a)$} $$
Edit: A simple example in which this can happen, is if $g$ is constant.
Another example would be $$ g(x) = \begin{cases}\sin\left(\frac{1}{x}\right) x^2 & \text{if $x\neq 0$}\\0 & \text{else}\end{cases} $$ This function is differentiable at $a=0$ (check :)) and you can set $x_n:= \frac{1}{\pi n}$ to obtain a sequence as described above.