Problem: Find the derivative of
Solution: This is a function defined by cases. We start by observing that at interiors of intervals that appear in the definition we can find the derivative by differentiating (using the usual rules) the appropriate expressions from the definition.
Thus for
We get
Now we need to explore situation at proper endpoints of the intervals. First we need to look at continuity. Why? If we know that a function is not continuous somewhere, then it cannot be differentiable there and we are done. On the other hand, if a function is continuous at some point, then we have one assumption satisfied in the theorem (in Theory - MVT - Derivative and limit) that allows us to find one-sided derivatives there using limits of derivatives. Fortunately, we need not look at continuity here, since we have already explored continuity of this function in Functions - Methods Survey - Basic properties - Continuity.
What do we know about
At
Since the one-sided derivatives agree, we have
At
Since the one-sided derivatives do not agree, there is no derivative at 1.
At
We can express the answer by including the point 0 in appropriate variants.
By th way, in Functions - Methods Survey - Basic properties - Continuity you will find a picture of this function, it might help you visualize things that we calculated here.