Infinite Differentiability and Generalisation of Mean Value Theorem I've some questions on Infinitely differentiable function. and Showing that a function is of class $C^{\infty}$, answers to which I would deeply appreciate.
$\large{1}$. Does "consequence of Lagrange theorem" refer to the following slight generalisation of the Mean Value Theorem? It's from Spivak's Calculus, 3rd Ed, P197, Question 11.45.

Hypothesis 1: $f$ is continuous and differentiable on $(a,b)$ $\color{purple}{\text{(unlike MVT which requires $f$ to be continuous on [a,b])}}.$
  Hypothesis 2: $\exists \underset{y\to {{b}^{-}}}{\mathop{\lim }}\,f(y)\text{ and}\underset{y\to {{a}^{+}}}{\mathop{\lim }}\,f(y).$
  $ \text{Then }\exists \text{ some }c\in (a,b)\text{ such that }f'(c)=\frac{\underset{y\to {{b}^{-}}}{\mathop{\lim }}\,f(y)-\underset{y\to {{a}^{+}}}{\mathop{\lim }}\,f(y)}{b-a}.$

$\large{2}$. What's the intuition for this slight generalisation? My interpretation is that it is the Mean Value Theorem for endpoints that are open as removable continuities (instead of closed endpoints in MVT). In other words, compared with the the picture for MVT, $f(a)$ and $f(b)$ may now be undefined and may be holes.
$\large{3}$. What would motivate or inspire you to guess this slight generalisation of the Mean Value Theorem? My attempt was just to draw the picture describing MVT and then divining that it may be true in the more general case that $f(a)$ and $f(b)$ were holes.
$\large{4}$. How would you foresee or know to use this slight generalisation to prove $f^{n}(0) = 0$? This is what the two links above do.
Thank you very much.

@ChristianBlatter: Thank you very much to Christian Blatter's post. Some supplemental questions:
$
{\huge{3}}.\color{green}{\text{"Spivak's version }} \text{follows easily when you consider the extended function $ \\g:[a,b] \to \mathbb{R}$ obtained from } \color{red}{f} \text{ by defining $g(a)$ and $g(b)$ in the obvious way."}\\ 
\text{Did you mean:} \color{green}{\text{''The ordinary Mean Value Theorem"}} \text{and}  \color{red}{\text{ Spivak's $f$ }}?$
${\huge{5}}.$ What's "the obvious way"?
${\huge{4}}.$By differentiating $n$ times (ie by induction), $f(0) = 0 \implies f^{(n)}(0) = 0$ . 
To show $ f\in C^{\infty} $ at $x= 0$, why did you then consider $$\lim_{x\to 0+}{f^{(n)}(x)-f^{(n)}(0)\over x}=0? $$ How did you know to consider this limit?
 A: ad 1: There are many "Lagrange theorems". It is unclear to me what is meant by "consequence of Lagrange theorem" mentioned in that link; so much the more as the link "Lagrange theorem" leads to the MVT without any reference to Lagrange.
ad 2 and 3: In many calculus texts the assumptions for the MVT are "$f$ continuous on $[a,b]$ and differentiable on $(a,b)$". This makes the theorem applicable, e.g.,  to $f(x):=\sqrt{1-x^2}$ on $[{-1},1]$. When these assumptions seem somewhat contrived to you you can replace them by Spivak's assumptions in your highlighted text. Spivak's version follows easily when you consider the extended function $g:\ [a,b]\to{\mathbb R} $ obtained from $f$ by defining $g(a)$ and $g(b)$ in the obvious way. The extension $g$ is continuous on all of $[a,b]$.
ad 4: That $f^{(n)}(0)=0$ for 
$$f(x) :=\cases{e^{-1/x}\quad&$(x>0)$\cr 0&$(x\leq0)$\cr}$$ is most easily proven by induction. Given that for some polynomial $p_n$, 
$$f^{(n)}(x) = \cases{p_n(1/x)\>e^{-1/x}\quad&$(x>0)$\cr 0&$(x\leq0)$\cr}$$
it follows that $f^{(n+1)}(x)=p_{n+1}(1/x)e^{-1/x}$ for $x>0$, and
$$\lim_{x\to 0+}{f^{(n)}(x)-f^{(n)}(0)\over x}=0\ ,$$
etcetera.
