If $f(x)$ is continuous at $x=g(a)$, and $g(x)$ is continuous at $x=a$, then $\lim_{x\rightarrow a} f(g(x)) = \lim_{g(x)\rightarrow g(a)} f(g(x))$ If $f(x)$ is continuous at $x=g(a)$, and $g(x)$ is continuous at $x=a$, then $\lim_{x\rightarrow a} f(g(x)) = \lim_{g(x)\rightarrow g(a)} f(g(x))$
Is this proof for the above statement correct? If not, is the statement correct, and is there an easy proof of it? I ask because I think this would make the first proof of the 1-d chain rule on wikipedia more elegant, and it seems correct to me, but I'd like to check if I messed up.
If $g(x)$ is continuous at $x=a$ and $f(x)$ continuous at $x=g(a)$, then $\lim_{x\rightarrow a} f(g(x)) = f(\lim_{x\rightarrow a} g(x))$. $g(x)$ is continuous at $x=a$, and so $\lim_{x\rightarrow a} g(x) = g(a)$. Since $f$ is continuous at $g(a)$, then $\lim_{x \rightarrow g(a)} f(x) = f(g(a))$. Thus $f(g(a))$ exists. Thus 
$$
f(\lim_{g(x) \rightarrow g(a)} g(x)) = f(g(a)) = \lim_{g(x) \rightarrow g(a)} f(g(x))= f(g(a)) = f(\lim_{x\rightarrow a} g(x)) = \lim_{x\rightarrow a} f(g(x))
$$
QED. And so in the wikipedia proof of the chain rule, one can simply say that because $f(x)$ is differentiable (and so continuous) at $x=g(a)$, and $g(x)$ is differentiable (and so continuous) at $x=a$, then it follows that
$$
(f \circ g)'(a) = \lim_{x\rightarrow a} \frac{f(g(x)) - f(g(a))}{x-a}
$$
$$
= \lim_{x\rightarrow a} \frac{f(g(x)) - f(g(a))}{g(x)-g(a)} \frac{g(x) - g(a)}{x-a}
$$
$$
= \lim_{x\rightarrow a} \frac{f(g(x)) - f(g(a))}{g(x)-g(a)} \lim_{x\rightarrow a}\frac{g(x) - g(a)}{x-a}
$$
$$
= \lim_{g(x)\rightarrow g(a)} \frac{f(g(x)) - f(g(a))}{g(x)-g(a)} \frac{dg}{dx}(a)
$$
$$
= \frac{df}{dg}(g(a))\frac{dg}{dx}(a)
$$
 A: Your proof for continuity of composition of functions is not rigorous enough as you kept repeating
that $\lim_{x \to a}f(g(x))= f\left( \lim_{x \to a}g(x) \right)$ without actually
proving this fact. It should be better if you prove this by following the 
definition of limits.
Even with the continuity of composition of functions, the chain rule cannot be 
proven like that. To explain this, let's review the definition of limit:
Definition. A function $f:\mathbf{R} \to \mathbf{R}$ is said to be continuous at $a$ if for every $\varepsilon>0$, there exists $\delta>0$ such that $|f(x)-f(a)|<\varepsilon$ whenever $0\color{red}{<}|x-a|<\delta$.
Notice the that the definition does not require anything about $f(a)$. In particular, $f$ can be continuous at $a$ while $f(a)$ is any number. 

Now, let's back to your proof of the chain rule. Note that the limit $\lim_{x \to a}\frac{f(g(x))-f(g(a))}{g(x)-g(a)}$ may be undefined even if we know that $f$ is differentiable at $x=g(a)$, i.e. $\lim_{x \to a}\frac{f(x)-f(g(a))}{x-g(a)}$ exists. 
In particular, if $g(x)=g(a)$ for all $0<|x-a|<\delta$ for some $\delta>0$ then 
$\frac{f(g(x))-f(g(a))}{g(x)-g(a)}$ is undefined, which means the limit 
$\lim_{x \to a} \frac{f(g(x))-f(g(a))}{g(x)-g(a)}$ is undefined.
On the other hand, $f$ is differentiable at $g(a)$ means $\lim_{x \to a} 
\frac{f(x)-f(g(a))}{x-g(a)}$ exists. Observe that $\frac{f(x)-f(g(a))}{x-g(a)}$ is always defined for any $x$ so $0<|x-g(a)|<\delta$.
