TITLE: Nowhere continuous real valued function which has an antiderivative
QUESTION [9 upvotes]: My question:
Is there a function $f: \mathbb{R} \rightarrow \mathbb{R}$ that nowhere continuous on its domain, but has an antiderivative? 
If there is no such a function,  is it true to conclude that: to have an antiderivative, $f$ is necessary to be continuous at least at one point on its domain?
Any comments/ inputs are highly appreciated. Thanks in advance.

REPLY [11 votes]: There is no such function. 
In fact, by an application of Baire's theorem one can show that, given a sequence of continuous functions $f_n:\mathbb R \to \mathbb R$, which converges pointwise, i.e. $f_n(x)\to f(x)$ for each $x\in \mathbb R$, the set of points where $f$ is continuous is a dense $G_\delta$-set.
Applied to your situation, we can consider the sequence $$f_n(x) = \frac{f(x+1/n) - f(x)}{1/n}$$ All of these functions are continuous and converge pointwise to $f'(x)$. So $f'(x)$ must be continuous on a dense $G_\delta$-set.
So you are right with your second statement: For a function $g$ to be the derivative of some other function, $g$ necessarily has to have at least one point of continuity.

REPLY [6 votes]: If you want your antiderivative to be differentiable everywhere, this is impossible since the derivative of a differentiable function $F: \mathbb R \to \mathbb R$ can be realized as a pointwise limit of continuous functions (use the "$\lim_{h\to0} \frac{f(x+h)-f(x)}h$"-definition of differentiability to construct a suitable sequence), and the pointwise limit of a sequence of continuous functions from $\mathbb R$ to $\mathbb R$ must be continuous on a comeagre set by the Baire-Osgood theorem.