In order to be differentiable everywhere, must first be continuous everywhere, which means the limits from either side as must be the same and equal to . By definition, , and
so we need to have .
For to be differentiable at , the derivative needs to be continuous at , i.e.