Let $f:[a,b] \rightarrow \mathbb{R}$ be a function which is continuous on $(a,b]$ and differentiable on $(a,b)$. Is there any function such that $f(b)-f(a)≠(b-a)f'(x), \forall x\in (a,b)$?
There was a typo, and now it's edited. I wanted to know whether compactness of a set where $f$ is continuous on is essential.