What is wrong with the following statement:
Let $f(x)$ be Riemann-integrable, $$F(x)=\int_a^x f(t)dt.$$ Then $F(x)$ is differentiable, and $F'(x)=f(x)$ almost everywhere.
I think the statement is true. Because $f(x)$ be Riemann-integrable, it's continuous almost everywhere. Then by the Second Fundamental Theorem of Calculus, $F(x)$ is is differentiable almost everywhere, and $F'(x)=f(x)$ almost everywhere.
Quick answer: $f$ is Riemann integrable iff $f$ is bounded and continuous almost everywhere (a characterization due to Lebesgue).
In elementary analysis, it is well-known that if $f$ is continuous at $x$, then $F'(x)$ exists and $F'(x)=f(x)$.