Rolle's theorem: what's the right statement of the theorem? In the fourth edition of "Introduction to Real Analysis" by Bartle and Sherbert, theorem 6.2.3 (Rolle's theorem) states,

Suppose that f is continuous on a closed interval $I := [a, b]$, that
  the derivative of $f$ exists at every point of the open interval $(a, b)$, and that $f(a) = f(b) = 0$.
  Then there exists at least one point $c$ in $(a, b)$ such that the derivative of $f$ is zero at $c$.

Now, why are we taking $f(a)=0=f(b)$? Is $f(a)=f(b)$ not sufficient?
 A: The two versions are clearly equivalent. Suppose just $f(a)=f(b)$. Let $g(t)=f(t)-f(a)$. Then $g(a)=g(b)=0$, so the formally weaker version shows $g'(c)=0$, hence $f'(c)=0$ for some $c$.
A: You are right, taking $f(a) = f(b)$ is sufficient.
But, one can prove the theorem in this general scenario using the theorem for the case $f(a) = 0 = f(b)$, as follows:
Assume Rolle's theorem as stated in the question details is true. Let $f$ be a function satisfying the same hypotheses, except that $f(a) = f(b) = k$, where $k$ is not necessarily equal to zero. Then, the function $g(x) = f(x) - k$ satisfies the hypotheses of Rolle's theorem, and so there is a point $c$ such that $g'(c) = 0$. But $g'(c) = f'(c)$, so we are done.
So, it doesn't really matter which one we use, as both versions are seen to be equivalent to each other.
A: Yes, you are right: $f(a)=f(b)$ is enough. However, it is usual to add the condition $=0$ after $f(a)=f(b)$ so that the theorem becomes: between two roots of $f$, there's a root of $f'$, which is the original theorem due Michel Rolle (who stated it for polynomials only).
Anyway, this is a moot point, since both statements are just a particular case of the Mean Value Theorem.
