Hint: It is better to start over again. Use the Mean Value Theorem (MVT), or the special case of MVT sometimes called Rolle's Theorem.
Note that the way the problem is worded, the result is not quite true. The condition on the derivative says nothing about the values of $f$ at the endpoints $a$ and $b$.
Added: Let $a\lt c\lt d \lt b$. Then by the Mean Value Theorem, we have
$$\frac{f(d)-f(c)}{d-c}=f'(\xi)$$
for some $\xi$ between $c$ and $d$. It follows that $f(c)=f(d)$. From this we can see that $f(x)=f(y)$ for all $x,y$ in the open interval $(a,b)$.
Let this common value be $k$. Then $f(x)=k$ on $(a,b)$. If $f$ is (right)-continuous at $a$ and (left)-continuous at $b$, we can further conclude that $f(a)=f(b)=k$.
Remark: The result is indeed obvious, at least with the usual informal interpretation of derivative as rate of change: If your velocity is always $0$, you ain't going nowhere. However, differentiable functions can be very weird, and intuition about the smooth curves of our imagination cannnot always be relied on.
The MVT is of great importance because it enables us to use local information about a function (its derivative) to obtain global information about the function, such as whether it is increasing on an interval.
The reason that I suggested starting over is that continuing on the path you were taking, though possible, is quite difficult.