how to prove the chain rule? I have just learned about the chain rule but my book doesn't mention the proof. I tried to write a proof myself but can't write it. So can someone please tell me about the proof for the chain rule in elementary terms because I have just started learning calculus.
 A: One approach is to use the fact the "differentiability" is equivalent to "approximate linearity", in the sense that if $f$ is defined in some neighborhood of $a$, then
$$
f'(a) = \lim_{h \to 0} \frac{f(a + h) - f(a)}{h}\quad\text{exists}
$$
if and only if
$$
f(a + h) = f(a) + f'(a) h + o(h)\quad\text{at $a$ (i.e., "for small $h$").}
\tag{1}
$$
(As usual, "$o(h)$" denotes a function satisfying $o(h)/h \to 0$ as $h \to 0$.)
If $f$ is differentiable at $a$ and $g$ is differentiable at $b = f(a)$, and if we write $b + k = y = f(x) = f(a + h)$, then
$$
k = y - b = f(a + h) - f(a) = f'(a) h + o(h),
$$
so $o(k) = o(h)$, i.e., any quantity negligible compared to $k$ is negligible compared to $h$. Now we simply compose the linear approximations of $g$ and $f$:
\begin{align*}
f(a + h) &= f(a) + f'(a) h + o(h), \\
g(b + k) &= g(b) + g'(b) k + o(k), \\
(g \circ f)(a + h)
  &= (g \circ f)(a) + g'\bigl(f(a)\bigr)\bigl[f'(a) h + o(h)\bigr] + o(k) \\
  &= (g \circ f)(a) + \bigl[g'\bigl(f(a)\bigr) f'(a)\bigr] h + o(h).
\end{align*}
Since the right-hand side has the form of a linear approximation, (1) implies that $(g \circ f)'(a)$ exists, and is equal to the coefficient of $h$, i.e.,
$$
(g \circ f)'(a) = g'\bigl(f(a)\bigr) f'(a).
$$
One nice feature of this argument is that it generalizes with almost no modifications to vector-valued functions of several variables.
A: First, let me give a careful statement of the theorem of the chain rule:

THEOREM: 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) \, .
$$

Now for the proof. Define the function $\phi$ as follows:
$$
\phi(y)=\begin{cases}
\dfrac{f(y)-f(g(a))}{y-g(a)}&\text{if $y-g(a)\neq0$,} \\[5pt]
f'(g(a))&\text{if $y-g(a)=0$.}
\end{cases}
$$
Since
$$
f'(g(a))=\lim_{y \to g(a)}\frac{f(y)-f(g(a))}{y-g(a)} \, ,
$$
$\phi$ is continuous at $g(a)$. Moreover, $g$ is continuous at $a$ because it is differentiable at $a$. Since the composition of continuous functions is continuous, $\phi \circ g$ is continuous at $a$. This fact is used below on line $\eqref{*}$.
Note that for all $x\neq a$,
$$
\frac{f(g(x))-f(g(a))}{x-a}=\phi(g(x)) \cdot \frac{g(x)-g(a)}{x-a} \, .
$$
(This is true even if $g(x)-g(a)=0$, as in that case both sides are equal to $0$.) Hence,
\begin{align}
(f \circ g)'(a)&=\lim_{x \to a}\frac{f(g(x))-f(g(a))}{x-a} \\[5pt]
&= \lim_{x \to a}\phi(g(x)) \cdot \lim_{x \to a}\frac{g(x)-g(a)}{x-a} \\[5pt]
&= \phi(g(a)) \cdot g'(a) \tag{*}\label{*} \\[5pt]
&= f'(g(a)) \cdot g'(a) \blacksquare
\end{align}
For an explanation of how this proof was motivated, see pages 177 onwards of Michael Spivak's Calculus. Note that my definition of the function $\phi$ is different to Spivak's.
A: Assuming everything behaves nicely ($f$ and $g$ can be differentiated, and $g(x)$ is different from $g(a)$ when $x$ and $a$ are close), the derivative of $f(g(x))$ at the point $x = a$ is given by 
$$
\lim_{x \to a}\frac{f(g(x)) - f(g(a))}{x-a}\\ = \lim_{x\to a}\frac{f(g(x)) - f(g(a))}{g(x) - g(a)}\cdot \frac{g(x) - g(a)}{x-a}
$$
where the second line becomes $f'(g(a))\cdot g'(a)$, by definition of derivative.
A: As suggested by @Marty Cohen in [1] I went to [2] to find a proof. Under fair use, here I include Hardy's proof (more or less verbatim). 
We write $f(x) = y$, $f(x+h) = y+k$, so that $k\rightarrow 0$ when $h\rightarrow 0$ and 
\begin{align}
\label{eq:rsrrr}
\dfrac{k}{h} \rightarrow f'(x).    \quad \quad Eq. *
\end{align}
We must now distinguish two cases.
I. Suppose that $f'(x) \neq 0$, and that $h$ is small, but not zero. Then $k\neq 0$ because of Eq.~*, and
\begin{align*}
\dfrac{\phi(x+h) - \phi(x)}{h} &= \dfrac{F(y+k) - F(y)}{k}\dfrac{k}{h} \rightarrow F'(y)\,f'(x) 
\end{align*} 
II. Suppose that $f'(x) = 0$, and that $h$ is small, but not zero. There are now two possibilities
II.A. If $k=0$, then 
\begin{align*}
\dfrac{\phi(x+h) - \phi(x)}{h}&= \frac{F\left\{f(x+h)\right\}-F\left\{f(x )\right\}}{h}
\\
&= \frac{F\left\{y\right\}-F\left\{y\right\}}{h} 
\\
&= \dfrac{0}{h}
\\
&= 0 = F'(y)\,f'(x)
\end{align*} 
II.B. If $k\neq 0$, then 
\begin{align*}
\dfrac{\phi(x+h) - \phi(x)}{h}&= \frac{F\left\{f(x+h)\right\}-F\left\{f(x )\right\}}{k}\,\dfrac{k}{h}.
\end{align*}
The first factor is nearly $F'(y)$, and the second is small because $k/h\rightarrow 0$. Hence $\dfrac{\phi(x+h) - \phi(x)}{h}$ is small in any case, and 
\begin{align*}
\dfrac{\phi(x+h) - \phi(x)}{h}&\rightarrow 0 =  F'(y)\,f'(x)
\end{align*} 
Bibliography
[1]Chain rule proof doubt
[2] G.H. Hardy, ``A course of Pure Mathematics,'' Cambridge University Press, 1960, 10th Edition, p. 217.
