Theorem 5.5 in Baby Rudin: Do we need the continuity of $f$ on the entire interval? Here is Theorem 5.5 in the book Principles of Mathematical Analysis by Walter Rudin, 3rd edition: 

Suppose $f$ is continuous on $[a, b]$, $f^\prime(x)$ exists at some point $x \in [a, b]$, $g$ is defined on an interval $I$ which contains the range of $f$, and $g$ is differentiable at the point $f(x)$. If $$h(t) = g \left( f(t) \right) \ \ \ (a \leq t \leq b), $$ then $h$ is differentiable at $x$, and 
  $$\tag{3} h^\prime(x) = g^\prime \left( f(x) \right) f^\prime(x).$$ 

And, here is Rudin's proof. 

Let $y = f(x)$. By the definition of the derivative, we have 
  $$ \tag{4} f(t) - f(x) = (t-x) \left[ f^\prime(x) + u(t) \right], $$
  $$ \tag{5} g(s) - g(y) = (s-y) \left[ g^\prime(y) + v(s) \right], $$
  where $t \in [a, b]$, $s \in I$, and $u(t) \to 0$ as $t \to x$, $v(s) \to 0$ as $s \to y$. Let $s = f(t)$. Using first (5) and then (4), we obtain 
  $$ 
\begin{align}
h(t) - h(x) &= g\left( f(t) \right) - g\left( f(x) \right) \\ 
&= \left[ f(t) - f(x) \right] \cdot \left[ g^\prime(y) + v(s) \right] \\ 
&= (t-x) \cdot \left[ f^\prime(x) + u(t) \right] \cdot \left[ g^\prime(y) + v(s) \right],
\end{align}
$$
  or, if $t \neq x$, 
  $$\tag{6} \frac{h(t) - h(x) }{t-x} = \left[ f^\prime(x) + u(t) \right] \cdot \left[ g^\prime(y) + v(s) \right]. $$
  Letting $t \to x$, we see that $s \to y$, by the continuity of $f$, so that the right side of (6) tends to $g^\prime(y) f^\prime(x)$, which gives (3). 

Now my question is, is the continuity of $f$ on the entire interval $[a, b]$ essential in this theorem as Rudin has stated and proved it? Or, is it sufficient to just assume the continuity of $f$ at the point $x \in [a, b]$? 
 A: I think it is sufficient to just assume the continuity of $f$ in $x$ and not in the hole interval. That is because the only place he actually uses the continuity of $f$ in the proof is for showing $\lim_{~t\rightarrow x}v(s) = 0$. There are other places in the proof where the differentiability in $x$ is used, but not the continuity itself. To show that $\lim_{~t\rightarrow x}v(s) = 0$, however, doesn't require the continuity of $f$ in the hole interval:
From the Rudin's proof it follows that $\lim_{~s\rightarrow y}v(s) = 0$ therefore, for every given $\epsilon$, there exist $\beta$ such that:
$$0<|s-y|<\beta\Rightarrow |v(s)|<\epsilon$$
Using the continuity in $x$ it follows that for for every given $\beta$, there exist $\delta$ such that:
$$|t-x|<\delta\Rightarrow |s-y|<\beta$$
and therefore:
$$|t-x|<\delta\Rightarrow |s-y|<\beta\Rightarrow |v(s)|<\epsilon$$
and: $\lim_{~t\rightarrow x}v(s) = 0$ 
A: The proof only uses the facts that $f$ is differentiable (hence continuous) at $x$ and that $g$ is differentiable at $f(x)$.
For $h \ne 0$ let
$\phi(h) = {g(f(x+h))-g(f(x)) \over h}$. Let $Z = \{ h | f(x+h) = f(x) \}$.
Note that we can write
$\phi(h) = \begin{cases} {g(f(x+h))-g(f(x)) \over f(x+h)-f(x)} {f(x+h)-f(x) \over h}, & x \notin Z \\
0, & x \in Z \end{cases}$.
Note that $\lim_{h \to 0} {f(x+h)-f(x) \over h} = f'(x)$ and
$\lim_{\eta \to 0} {g(f(x)+\eta)-g(f(x)) \over \eta} = g'(f(x))$.
If $0$ is not a limit point of $Z$, we see that $\lim_{h \to 0} \phi(h) = g'(f(x)) f'(x)$.
If $0$ is a limit point of $Z$ we must have $f'(x) = 0$ and we see
$\lim_{h \to 0, h \in Z} \phi(h) = 0$.
If $0$ is a not a limit point of $Z^c$ we are finished, otherwise we have $\lim_{h\to 0, h \notin Z} \phi(h) = g'(f(x)) \cdot 0$. Combining
the two gives 
$\lim_{h\to 0} \phi(h) = 0 = g'(f(x)) f'(x)$.
