I'm a little confused by what you mean by "both the points which they are undefined". As you have written it this function is defined everywhere, and so are the derivatives.

To take derivatives of piecewise functions you take the derivative of each piece and keep the bounds on x the same.

For instance,

if f(x) = 2x for x<0 and f(x)=x^2 for x>=0 then

the first derivative will be

f'(x)=2 for x<0 and f'(x)=2x for x>=0.

Hope this helps with your problem!