Proof of Fundamental Theorem of Calculus using big O
The usage of $O(h^2)$ is wrong here. Just continuity can't ensure this. On the other hand if $f$ is differentiable then we can write $f(t) =f(x) +O(h) $ and integrating this gives the desired result in question.
The proof presented in your question is thus making an extra assumption and IMHO full credit should not be provided if this comes as an answer to a question in exam.