EDIT 2: Anyway, this is what I came up with:

You found that

when

. I agree with this part.

**Good to know I did something right :S**
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 should

**not** think 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.

** I follow you on this as well, that the limit may exist on both sides, but not necessarily equal**
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.

**That makes sense.**
For the second part we need to check

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

**Okay, took a minute to realize, but yes - I agree**
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.

**What about p = 2? **
I think this is right but again it's been a while, so please check my work and see if you agree.

**The work is very complicated, and it will take my mind 10 minutes to understand, but for now, let's agree that the work is correct. I thank you for your help, greatly.**