Specifically, I mean a Riemann sum of $f$ over $[a,b]$ that is equal to $\int_a^b f$.
I encountered this question on my analysis exam, but I was unable to answer it. I thought it was an interesting result, so I tried to find a proof when I returned home. To my surprise, I was unable to find one. How would one go about proving this? I am honestly completely stumped.
Note that you can simplify the other answers given. Apply the mean value theorem to $g(t)=\int_a^t f(x) \, dx$. Then there exists $c\in (a, b)$ such that $f(c) = \frac{g(b)-g(a)}{b-a} = \frac{\int_a^b f \, dx}{b-a}$. Multiply both sides by $b-a$ to get $\int_a^b f=f(c)(b-a)$, and you have a Riemann sum with the trivial partition.