Darboux's Theorem states that" If $f$ is differentiable on $[a,b]$ and if $k$ is a number between $f^{\prime}(a)$ and $f^{\prime}(b)$, then there is at least one point $c\in (a,b)$ such that $f^{\prime}(c) = k$."
Most commonly found proof goes as follows: Suppose that $f^{\prime}(a) < k < f^{\prime}(b)$. Let $F:[a,b]\rightarrow \mathbb{R}$ be defined by $F(x) = f(x) -kx$ so that $F^{\prime}(x) = f^{\prime}(x) -k$. Then $F$ is differentiable on $[a,b]$ because so is the function $f$. We find $F^{\prime}(a) = f^{\prime}(a) -k <0$ and $F^{\prime}(b) = f^{\prime}(b) -k >0$. Note that $F^{\prime}(a) <0$ means $F(t_1)< F(a)$ for some $t_1\in (a,b)$. So, $F$ can not attain its minimum at $x=a$. Also, for $F^{\prime}(b)>0$, we can find $t_2\in (a,b)$ such that $F(b) < F(t_2)$. Thus neither $a$ nor $b$ can be a point where $F$ attains a local maximum or a local minimum. Since $F$ is continuous on $[a,b]$, it must attain its maximum at some point $c\in (a,b)$. This means that $F^{\prime}(c) = 0$ and hence $f^{\prime}(c) = k$ as desired.
My question is how can one conclude that $F^{\prime}(b) > 0$ means $F$ can not attain a maximum at $x=b$, the end point of the interval. Look at the example $f(x) =x^2$ on $[0,1]$, has absolute maximum at $x =1$ though $f^{\prime}(1) =2 >0$. Have I misunderstood any logic here? Please somebody explain this. Thanks !!!