Differentiable vs continuous
The derivative of $f$ is equal to $1$ on each sector and so $f$ is differentiable at $0$
Incorrect. $f$ is not differentiable at $0$.
In order for $f$ to be differentiable at zero, $\lim\limits_{h \to 0} \frac{f(h) - f(0)}{h - 0}$ would have to exist. This limit does not exist. In particular, if we take the limit from the left, we get $\lim\limits_{h \to 0-} \frac{h - 1}{h} = \infty$ while the limit from the right is $\lim\limits_{h \to 0+} \frac{h + 1 - 1}{h} = 1$.
Another way of noting that $f$ is not differentiable at $0$ is by noting that $f$ is not continuous at zero. Since a function is continuous at any point where it’s differentiable, $f$ must not be differentiable at $0$.
There is a theorem which you might have been thinking of when solving your problem. If $f$ is continuous at zero and $\lim\limits_{h \to 0} f’(h) = L$, then $f’(0) = L$. The proof of this theorem involves using the mean value theorem.
However, note that a key requirement of this this theorem - that $f$ is continuous at $0$ - is not satisfied here.