Let's consider $f:[a,b]\to\mathbb{R}$ which is differentiable in each $x\in ~\!]a,b[$. Consequently $f$ is also continuous in those points. But we don't require that $f$ is continuous in $a$ and $b$. (Remark: $]a,b[$ denotes the interval $(a,b)$ without $a$ and $b$ and $[a,b]$ includes $a$ and $b$)
However, the mean value theorem (see https://en.wikipedia.org/wiki/Mean_value_theorem#Formal_statement) requires that $f$ must also be continuous in the boundary points $a,b$.
Why do we need this? Is there a counter example that shows that the mean value theorem doesn't work if this condition is violated?