Existence of an open interval on which $f'$ is bounded Recently we've just begun to learn derivative, and our teacher left the following problem.

Let $f:\mathbb{R}\to \mathbb{R}$ be differentiable on $\mathbb{R}$. Show that there is an open interval $(a,b)$ on which $f'$ is bounded.

Since we've only come to the definition of derivative, the problem seems remote. Yet our teacher encouraged us to try. I've tried to disprove the opposite, but it didn't work. Please help. A mere hint will do.
 A: I don't see how one could find a proof when just starting to learn about derivatives, since the only proofs I have so far come up with either use Baire's theorem or prove a special case of it (the proof can of course be generalised).
In fact, a stronger assertion holds, every nondegenerate interval $(a,b)$ contains a nondegenerate subinterval $(c,d)$ on which $f'$ is bounded. Thus in a hand-waving sense derivatives are "almost locally bounded".
To see this, write the derivative as the limit of a sequence of continuous functions, for example let
$$g_n(x) = \frac{f\bigl(x + \frac{1}{n}\bigr) - f(x)}{\frac{1}{n}}$$
for each positive integer $n$. Taking any sequence $(a_n)$ of nonzero real numbers converging to $0$ in place of $\frac{1}{n}$ would work the same. Since $f$ is assumed to be everywhere differentiable, we have $\lim_{n \to \infty} g_n(x) = f'(x)$ for all $x \in \mathbb{R}$. Since each $g_n$ is continuous, the sets
$$A(n,k) = \{x \in \mathbb{R} : \lvert g_n(x)\rvert \leqslant k\}$$
are closed for all positive integers $n,k$ (it is of course not essential that $k$ is an integer, any nonnegative real number would do). Then define
$$F_k = \bigcap_{n = k}^{\infty} A(n,k).$$
As an intersection of closed sets, $F_k$ is closed, and we have $\lvert f'(x)\rvert \leqslant k$ for every $x \in F_k$. Furthermore we have $F_k \subseteq F_{k+1}$ for all $k$, and
$$\bigcup_{k = 1}^{\infty} F_k = \mathbb{R}.\tag{$\ast$}$$
To see the latter consider an arbitrary $x \in \mathbb{R}$. Since $f'(x) \in \mathbb{R}$ there is a $k \in \mathbb{N}$ with $\lvert f'(x)\rvert < k-1$, and by definition of differentiability there is a $\delta > 0$ with
$$\biggl\lvert \frac{f(x+h) - f(x)}{h} - f'(x)\biggr\rvert < 1$$
for all $h$ with $0 < \lvert h\rvert < \delta$. By the Archimedian property there is an $m \in \mathbb{N}$ with $\frac{1}{m} < \delta$, and hence $\lvert g_n(x)\rvert < k$ for all $n \geqslant m$. It follows that $x \in F_{\max \{k,m\}}$.
Baire's theorem guarantees that there is a $k$ such that $F_k$ has nonempty interior (and since $F_k \subseteq F_{k+1}$ all $F_k$ from some point on have nonempty interior), which means there are $a < b$ with $(a,b) \subset F_k$ and hence $\lvert f'(x)\rvert \leqslant k$ for $x \in (a,b)$.
But if we cannot appeal to Baire's theorem we have to prove the assertion above. Thus suppose the assertion were false, that is, each $F_k$ has empty interior and choose arbitrary $a < b$ (for the stronger assertion, read that as "empty interior with respect to $(a,b)$", i.e. $(a,b) \cap F_k$ contains no nendegenerate interval). Since $F_1$ has empty interior $(a,b) \setminus F_1$ is a nonempty open set, thus there are $a_1 < b_1$ with $(a_1,b_1) \subset (a,b) \setminus F_1$. Choose $a_1 < \alpha_1 < \beta_1 < b_1$, then $[\alpha_1, \beta_1] \cap F_1 = \varnothing$. We continue in this way. If $\alpha_m < \beta_m$ have already been chosen with $[\alpha_m, \beta_m] \cap F_m = \varnothing$, then consider $(\alpha_m, \beta_m) \setminus F_{m+1}$. Since by assumption $F_{m+1}$ has empty interior, this is a nonempty open set, hence there are $a_{m+1} < b_{m+1}$ with $(a_{m+1},b_{m+1}) \subset (\alpha_m, \beta_m)\setminus F_{m+1}$. Now we can choose $a_{m+1} < \alpha_{m+1} < \beta_{m+1} < b_{m+1}$.
We thus obtain a sequence of nested intervals $[\alpha_1, \beta_1] \supset [\alpha_2, \beta_2] \supset \ldots$. By completeness of $\mathbb{R}$ we have
$$E := \bigcap_{m = 1}^{\infty} [\alpha_m, \beta_m] \neq \varnothing,$$
and $E \cap F_k = \varnothing$ for every $k$ since $E \subset [\alpha_k,\beta_k]$. But this contradicts $(\ast)$, thus the assumption that all $F_k$ have empty interior (relative to $(a,b)$) cannot hold.
