THEOREM 9(THE CHAIN RULE)
If $g$ is differentiable at $a$, and $f$ is differentiable at $g(a)$, then $f\circ g$ is differentiable at $a$, and $$(f\circ g)^{'}(a)=f^{'}(g(a))\cdot g^{'}(a).$$
My proof of this theorem is here:
(1) First consider the case in which for any positive real number $\epsilon$, there exists $h$ such that $0<|h|<\epsilon$ and $g(a+h)-g(a)=0$.
In this case, $\lim_{h\to 0} \frac{g(a+h)-g(a)}{h}=0$ since $g'(a)$ exists and there exists $h$ such that $0<|h|<\epsilon$ and $g(a+h)-g(a)=0$ for any positive real number $\epsilon$.
Let $\phi(h):= \frac{f(g(a+h))-f(g(a))}{g(a+h)-g(a)}$ if $g(a+h)-g(a)\neq 0$.
Let $\phi(h):=f'(g(a))$ if $g(a+h)-g(a) = 0$.
Then $\phi$ is continuous at $h=0$ since $f$ is differentiable at $g(a)$.
$\frac{f(g(a+h))-f(g(a))}{h} = \phi(h) \cdot \frac{g(a+h)-g(a)}{h}\to f'(g(a))\cdot 0 = f'(g(a))\cdot g'(a) \,\,(h\to 0)$.
(2) Second consider the case in which there exists a positive real number $\epsilon$ such that $0<|h|<\epsilon\implies g(a+h)-g(a)\neq 0.$
In this case $\frac{f(g(a+h))-f(g(a))}{h} = \frac{f(g(a+h))-f(g(a))}{g(a+h)-g(a)} \cdot \frac{g(a+h)-g(a)}{h}\to f'(g(a))\cdot g'(a) \,\,(h\to 0)$.
I don't like the function $\phi$ because it is artificial.
Can we prove the chain rule without using an artificial trick?