Is there any function $f$ which is differentiable on an open interval $(a,b)$ but is not continuous on (and also cannot be extended continuously to) the closed interval $[a,b]$?
Differentiability implies continuity, but the intervals $(a,b)$ and $[a,b]$ were not the same; the first was open second was closed. This means at the points $a$ and $b$ it can be not continuous and it will still be differentiable on open $a,b$.
Thusly you can have a function that does what you said.
For example, you could have $f(a) = 5$ and $f(x) =2$ otherwise (when $x \neq a$). This function will have a discontinuity at $x=a$.