It is already discontinuous at $a$ and $b$. So, make it unbounded at the endpoints. For example: $f(x) = \begin{cases}(x-a)\sin\left( \dfrac{1}{x-a} \right) & x > a \\ 0 & x = a\end{cases}$. Note that this function is continuous, but its derivative at a is not defined. In fact, its derivative approaches all real numbers as x approaches a. But, this function is differentiable on $(a,b)$.