For an arbitrary continuous $\mathbb{R}\to\mathbb{R}$, how to show that a certain Borel set is contained in the set of finite differentiability?
I think you're overthinking this slightly. The thing to remember is that we can turn logical syntax inside the set-builder notation into boolean-algebraic semantics outside the set-builder notation. That is
- $\{ x \mid \phi(x) \land \psi(x) \} = \{ x \mid \phi(x) \} \cap \{ x \mid \psi(x) \}$
- $\{ x \mid \exists n . \phi_n(x) \} = \bigcup_n \{ x \mid \phi_n(x) \}$
- $\{ x \mid \forall n . \phi_n(x) \} = \bigcap_n \{ x \mid \phi_n(x) \}$
- etc.
You can read more about this (and other syntax/semantics theorems) at a blog post I wrote a while ago here, but you can already see the utility with this problem. Indeed, the plan will be to expand out the definition of "the derivative of $f$ exists at $x$", then move this definition "outside" the set-builder notation as above. However, since we want things to be measurable, we'll have to use some (standard) tricks to make sure we only ever work with countable conjunctions/disjunctions.
We start with
$$ \{ x \mid f' \in \mathbb{R} \} = \left \{ x \ \middle | \ \lim_{h \to 0} \frac{f(x+h) - f(x)}{h} \text{ exists} \right \} $$
now if we expand out the definition of "this limit exists", we get $\exists L . \forall \epsilon . \exists \delta . |h| < \delta \to \left | \frac{f(x+h) - f(x)}{h} - L \right | < \epsilon$
Remember, we want to keep everything countable, but here we're already quantifying over uncountably many choices of $L$! Thankfully, there's a slick trick: we know that a sequence has a limit exactly when it's cauchy. So we can replace this formula with a formula saying that some sequence is cauchy!
$$ \left \{ x \ \middle | \ \forall \epsilon . \exists N . \forall m,n \geq N . \left | \frac{f(x + 1/n) - f(x)}{1/n} - \frac{f(x + 1/m) - f(x)}{1/m} \right | \leq \epsilon \right \} $$
(As a quick exercise, why is this OK? There are lots of sequences where $h \to 0$, but since $f$ is continuous at $x$ it doesn't matter which one we choose! If this isn't clear, it's worth working out the details carefully)
Now this still has a real-valued quantifier out front (the $\epsilon$) but of course, we can kill that quantifier too! If we know we can get $\leq \frac{1}{k}$ for any $k$ we like, then we can also get $\leq \epsilon$ for any $\epsilon$ we like! But the former is countable! This brings us to our final formula:
$$ \left \{ x \ \middle | \ \forall k . \exists N . \forall m,n \geq N . \left | \frac{f(x + 1/n) - f(x)}{1/n} - \frac{f(x + 1/m) - f(x)}{1/m} \right | \leq \frac{1}{k} \right \} $$
Now we cash out all the logic inside the set-builder for boolean operations outside the set-builder:
$$ \bigcap_k \bigcup_N \bigcap_{m,n \geq N} \left \{ x \ \middle | \ \left | \frac{f(x + 1/n) - f(x)}{1/n} - \frac{f(x + 1/m) - f(x)}{1/m} \right | \leq \frac{1}{k} \right \} $$
This is a sequence of countable unions and intersections applied to some sets. So if we can show that each $\left \{ x \ \middle | \ \left | \frac{f(x + 1/n) - f(x)}{1/n} - \frac{f(x + 1/m) - f(x)}{1/m} \right | \leq \frac{1}{k} \right \}$ is measurable, then we'll be done!
Of course, if we write $g_{m,n}(x) = \left | \frac{f(x + 1/n) - f(x)}{1/n} - \frac{f(x + 1/m) - f(x)}{1/m} \right |$, then this set is exactly $g_{m,n}^{-1} \left ( 0, \frac{1}{k} \right )$, which is definitely measurable (do you see why?)
I hope this helps ^_^
To finish the proof of the theorem, we need only show $S\subset \Delta(f)$, where $$S\,=\,\bigcap_{k=1}^{\infty} \,\bigcup_{n=1}^{\infty} \; \bigcap_{0 < |\eta| < \frac{1}{n}} \; \bigcap_{0 < |\delta| < \frac{1}{n}} \left\{x:\, \left| \frac{f(x + \eta) - f(x)}{\eta} \; - \; \frac{f(x + \delta) - f(x)}{\delta} \right| \, \leq \frac{1}{k}\right\},$$ $$\Delta(f)\,=\,\bigcup_{t\in \mathbb{R}}\,\bigcap_{\epsilon>0}\,\bigcup_{\zeta>0} \; \bigcap_{0 < |h| < \zeta} \left\{x:\, \left| \frac{f(x + h) - f(x)}{h} \; - \; t\right| \, \leq \epsilon\right\}.$$
(I acknowledge the suggestion of HallaSurvivor, who indicated that the Cauchy sequence idea is one way to succeed here.)
Let $x\in S$ be fixed. Let $g_x(\theta):\mathbb{R}\setminus\{0\}\to\mathbb{R}$ be $$g_x(\theta)=\frac{f(x+\theta)-f(x)}{\theta}.$$ The sequence $g_x(1),g_x(\frac12),g_x(\frac13),\dots$ is Cauchy, because $x\in S$. Let $t$ be the limit of this sequence.
Let $\epsilon$ be given. Let $k>2/\epsilon,$ and let $n\geqslant1$ correspond to $k$ in the definition of $S$. Let $m>n$ be such that $$\left|g_x\left(\frac1m\right)-t\right|<\frac\epsilon2.$$ Let $\zeta$ be such that $0<\zeta<\frac1m,$ and let $0<|h|<\zeta.$ Now estimate
$$\left| \frac{f(x + h) - f(x)}{h} -t \right| \; = \; \left|g_x(h) -t \right|$$ $$ \leqslant \left|g_x(h)- g_x\big(\frac1m\big)\right| + \left|g_x\big(\frac1m\big)-t\right| < \frac{1}{k}+\frac\epsilon2<\epsilon,$$ because $|\eta|=|h|<\zeta<\frac1n$ and $|\delta|=\frac1m<\frac1n.$