TITLE: Function whose integral is not continuously differentiable
QUESTION [5 upvotes]: While answering this question it occurred to me that there might be a function $f$ with the following properties:

$f$ is Riemann integrable on closed interval $[a, b] $.
The function $F$ defined by $$F(x) =\int_{a} ^{x} f(t) \, dt$$ is differentiable on $[a, b] $ (with one sided derivatives being considered at end points). 
There is a point $c\in(a, b) $ such that $F'$ is discontinuous at $c$ and $f'(c) $ exists.


I wasn't able to construct such an example myself. Do help in finding one such function or show that such a function does not exist. 


Clearly such an $f$ must be discontinuous at some points in $[a, b] $ and further its discontinuities must be of essential type and not the jump kind. The point $c$ must be a limit point of the set of discontinuities of $f$. Also via measure theory we must have $F'=f$ almost everywhere. I wonder if these properties are of any help here.

REPLY [5 votes]: We have existence of $F'(x) = \lim_{h \to 0} \frac{1}{h}\int_x^{x+h} f(t) \, dt$ for all $x \in (a,b)$. Since $f'(c)$ exists, $f$ is continuous at $c$ and $F'(c) = f(c)$.
Consider $h > 0$. We have
$$|F'(x) - F'(c)| = \left| \lim_{h \to 0+} \frac{1}{h}\int_x^{x+h} f(t) \, dt  - f(c)\right| = \left| \lim_{h \to 0+} \frac{1}{h}\int_x^{x+h} (f(t)-f(c)) \, dt  \right| \\ = \lim_{h \to 0+} \left|  \frac{1}{h}\int_x^{x+h} (f(t)-f(c)) \, dt  \right| \leqslant   \lim_{h \to 0+}  \frac{1}{|h|}\int_x^{x+h} |f(t)-f(c)| \, dt  $$
If $|x -c|< \delta$ then $|f(x) - f(c)| < \epsilon$. If $h$ is sufficiently small and $|x - c| < \delta/2$, we also have $|x+h - c| < \delta$ and $|f(t) - f(c)| < \epsilon$, whence
$$|F'(x) - F'(c)| < \lim_{h \to 0+}\frac{h}{|h|}\epsilon = \epsilon$$
Therefore $F'$ is continuous at $c$.