What would be a counterexample if hypothesis of mean value theorem is slightly changed?

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.

-
If $f \colon (a,b] \to \mathbb{R}$, then what is $f(a)$? – Antonio Vargas Nov 14 '12 at 18:28
How do you define $f(a)$ if $a$ is not in the domain of $f$? – copper.hat Nov 14 '12 at 18:28
If you think of the function $f$ as being defined for all reals, dropping the continuity at $a$ condition lets you assign $f(a)$ arbitrarily. This year, I like $f(x)=0$ on $(a,b]$ and $f(a)=2012$. – André Nicolas Nov 14 '12 at 18:32
I think this is a good way to think about theorems to see if you understand them. – Ross Millikan Nov 14 '12 at 18:35
Also, if your current version $f(b)-f(a)\ne (b-a)f'(x),\forall x\in (a,b)$ is correct, then any nonlinear function satisfies your criteria. I think you meant $\exists x\in (a,b)$. – rayradjr Nov 14 '12 at 18:36

1 Answer

Let $f(0)=-20, f(x)=0 \text{ for } x \in (0,1]$. Is this the sort of example you were thinking of?

-
Great! Thank you – Katlus Nov 14 '12 at 18:45