I realized I didn't know the answer to that question which seems simple, but I couldn't figure it out myself after reviewing my textbooks and draw a conclusion on my own. Suppose we have a function $f:I\to\mathbb{R}$, where $I$ is an interval of $\mathbb{R}$, $f$ is differentiable on $I$.
Is $f'$ automatically piecewise continuous ? That way it would have chance of being Riemann integrated.
Is there a pathological function, which can be differentiated, but its derivative is not piecewise continuous ? I know of the classic example $x\mapsto x^2\sin \frac{1}{x}$ which is differentiable everywhere but the derivative is discontinuous at $x=0$, but I can't think of a situation like this happening so much that you can't integrate $f'$.