$(f(c)-f(a))(f(b)-f(c))<0$ prove that there exists a $d$ such that $f'(d)=0$. I have a homework question which is:

If $f : [a,b]->R$ is continuous in $[a,b]$ and differentiable at
  $(a,b)$ and exists a point $c$ in $(a,b)$ such that
  $(f(c)-f(a))(f(b)-f(c))<0$ then prove that there is a point $d$ in
  $(a,b)$ such that $f'(d)=0$.

I am having trouble proving this - I am sure I am missing some simple algebra trick to show that $\frac {f(b)-f(a)}{b-a}=0$ or something like that...
Can someone help me please?
Thanks :)
 A: By hypothesis, $f(c)-f(a)$ and $f(b)-f(c)$ must have different signs. So either 
1) $f(c)>f(a)$ and $f(b)<f(c)$.
or
2) $f(c)<f(a)$ and $f(b)>f(c)$.
Suppose case 1) holds. Choose any number $r\ne f(c)$ between $f(c)$ and $\max\{f(a),f(b)\}$.
Then on the interval $[a,c]$, we have $f(a)\le r< f(c)$. By the Intermediate Value Theorem, there is a point $d$ in $[a,c]$ with $f(d)=r$.  Since $r\ne f(c)$, it follows that $d\in  [a,c)$.
On the interval $[c,b]$, we have $f(b)\le r<f(c)$. By the Intermediate Value Theorem, there is a point $e$ in $[c,b]$ with $f(e)=r$. Since $r\ne f(c)$, it follows that $e\in (c,b]$. 
Thus we have points $d\ne e$ in $[a,b]$ with $f(d)=f(e)$.
The Mean Value Theorem then gives a point $h\in(a,b)$ with 
$$f'(h)=
{f(e)-f(d)\over e-d}=
0.$$
I'll leave case 2) for you.

In Case 1:


the graph of $f$ intersects the line $y=r$ in each of the intervals $[a,c)$ and $(c,b]$.
A: Define $\ g(x):= (f(x)−f(a))(f(b)−f(x))$
Clearly g is continuos on $\ [a,b]$  and differentiable (a,b). Note that $\ g(a)=g(b)=0$. By weierstrass g attains its minimum value on the compact interval $\ [a,b]$. Now note that g(c)<0 some c in $\ (a,b) $. By that and the fact that g is zero on the endpoints of the interval it follows that $\ g'(d)=0$ some d in (a,b). But $\ g'(d)=f'(d)(f(a)+f(b)−2f(d))$. But now it follows that either f'(d)=0 in which case we are done, or $\ f(d)=(f(a)+f(b))/2$. But  $\ f(d)=f(a)+f(b)/2$ is false since if it was true then  $\ g(d)=(f(b)-f(a))^2$ Contradicting that $d \in (a,b) $ is the minimum value attained by  $\ g(x).$    
A: $(f(c)-f(a))(f(b)-f(c))<0\implies 2 case f(c)>f(a) and f(b)<f(c) or f(a)>f(c) and f(b)>f(c)$
From both cases,it is easy to use MVT to show the slope of the function f(x) consist of positive and negative and we can concluded that by contiunity,there must exist a number d st $f'(d)=0$
