I was mystified by your definition of f(x) at first but eventually realized you meant f(x) is defined piecewise as when and when . (I'm not sure how to make it look nice with a big left brace in LaTeX.)

I'll edit this post in a bit to address the problem itself, but thought it might help others to know what f(x) is in the meantime.

EDIT 1: It's been a while since I've done these, so first, a sketch:

f(x) is differentiable at if both left and right derivatives exist at and they are equal.

We'll only need to check the case because it's pretty clear that the derivative is well defined when .

I'll edit again when I get a bit further.

EDIT 2: I realized just now that it's more convenient for everyone if people make new replies rather than editing existing posts. That way, the poster gets to use the "preview" feature, and everyone else can get email notification. Sorry, I'm new here.

Anyway, this is what I came up with:

You found that

when . I agree with this part.

In what follows, when I assign a name to a limit (like ), I mean that this name applies only in the case that the limit exists.

We should use the definitions for right-derivative

and left-derivative,

to find out whether f(x) is differentiable at x=a=0. If both limits exist and then the derivative exists and . We shouldnotthink only in terms of

because it's possible that f'(0) exists but either (1) doesn't exist, or (2) exists but , and in both cases (1) and (2), f(x) will be differentiable, but the derivative will not be continuous. It is also generally possible for to exist but f'(0) to not exist, in which case f(x) will not be differentiable but we might mistakenly think it is. This is a bit tricky to realize, but I believe it's the whole point of the problem.

So first, the right derivative:

If p = 1, then we have

which does not exist since sin(1/h) oscillates an infinite number of times in any closed interval [0, b], b > 0.

If p > 1, then we'll be able to use the sandwich theorem (aka squeeze theorem) to determine that both right- and left-derivatives exist and equal 0.

So the first part of the question is answered: f(x) is differentiable if and only if p > 1.

For the second part we need to check

I believe it's most useful to express f'(x) like this

because otherwise we might fall into a certain trap: if and is undefined, it would be wrong to conclude that , for example consider and .

Anyway it's my understanding that

only exists when p > 2, in which case it will be 0 by the sandwich theorem. So overall f'(x) will be continuous only in the case p > 2.

I think this is right but again it's been a while, so please check my work and see if you agree.

By the way in LaTeX the way to get superscripts with more than one character is like this, without spaces: [ math]x^{p-1}[ /math].