Proving Rolle's Theorem Trying to prove Rolle's Theorem, which says that for a function $f$ continuous over $[a,b]$ and differentiable over $(a,b)$ (no idea why the endpoints aren't included here), such that $f(a) = f(b)$, then there exists a point $c$ where $a \lt c \lt b$ and $f'(c) = 0$.
It makes sense to me intuitively but I am not actually sure how you prove it.
If $f$ is a constant function $f(x) = k$ then at least I can show that $f(a) = f(c) = f(b) = k$, and $f'(c) = \lim_{h \to 0} \frac{f(c+h) - f(c)}{h} = \lim_{h \to 0} \frac{k - k}{h} = \lim_{h \to 0} \frac{0}{h} = 0$.
But if $f$ is not a constant function I'm at a loss because there are infinitely many types of functions that could be connecting the points at $(a,f(a))$ and $(b,f(b))$. I don't know how to prove that there must be at least one maximum or minimum present in between.
But let's suppose we know such a maximum exists at $x=c$. This means $f(c+h) \leq f(c)$ for all $h$. Then:
$$f'(c) = \lim_{h \to 0-}\frac{f(c+h) - f(c)}{h} \geq 0$$
$$f'(c) = \lim_{h \to 0+}\frac{f(c+h) - f(c)}{h} \leq 0$$
(Do I need to prove these two statements more explicitly? The numerator is always $\leq 0$ and the direction of the inequality depends on whether $h>0$ or $h<0$)
Since $f$ is continuous, $f(c)$ is defined and equal to the two-sided limit, so 
$$f'(c) = \lim_{h \to 0}\frac{f(c+h) - f(c)}{h} = 0$$
I mean is this enough to prove it?
 A: I would rearrange your start a little.


*

*By the extreme value theorem, there is a $c \in [a,b]$ which is a maximum of $f$ on $[a,b]$ and a $d \in [a,b]$ which is a minimum of $f$ on $[a,b]$.  If these are both attained at the endpoints, then $f(a) = f(b) = f(c) = f(d)$, so $f$ is constant on $[a,b]$ and its derivative is zero everywhere on $[a,b]$.

*So suppose at least one of the maximum and the minimum are not attained at the endpoints.  (That is either the endpoints are strictly less than the maximum, the endpoints are strictly greater than the minimum, or both.)  We may suppose the maximum is attained in the interior, so $c \in (a,b)$.  (If it is only the minimum that is attained in the interior, we replace $f$ with $-f$ to convert to a maximum of $-f$ attained in the interior.)
[Observe that the parabola $x^2$ on $[-1,1]$ attains its maximum on the endpoints and its minimum in the middle, and $-x^2$, vice versa, so this fiddling with minus signs isn't just formalism.]

*Observe that $f$ is differentiable at $c$, so both of the one-sided limits exist.  Do not include "$f'(c) = $".  By inspecting the signs, we get your two inequalities for these two one-sided limits.  Then recall that $f$ is differentiable at $c$, so these two limits must be equal to each other, hence to zero, and must be the derivative at $c$.  
[This is pretty much what you did.  But you are building up to the derivative, so you should lay out the parts (the one-sided derivatives), then assemble them.  Otherwise you have more to explain -- "Why is this first one-sided limit the derivative?  Why is this second one-sided limit the derivative?  Wait, how can these two different expressions be the same thing?".  However, if you just say "this limit is non-negative, this limit is non-positive, and since $f$ is differentiable here, these limits are equal, zero, and $f'$", you have less you have to explain before you can explain what you need to explain.]


(As an alternative to the one-sided limits, use Fermat's theorem directly: $c$ is a point where $f$ has a local extremum, $f$ is differentiable on $(a,b)$, containing $c$, so $f'$ is zero at $c$.  Notice if we go this way, we don't have to fiddle with minus signs, since whichever extremum is in the interior is the point with a zero derivative.)
