Using the "default value" syntax of Piecewise[] one can define the function equal to x*sin(1/x) for non-zero x and equal to 0 for x=0 in the following compact form:
y[x_] := Piecewise[{{x*Sin[1/x], x != 0}}]
Now, if we try to calculate the value of its derivative at x=0, then Mathematica assumes that it depends only on the value of y[x] at x=0:
y'[0]
0
But of course this is not true --- this function is not differentiable at x=0, because for x!=0 we have:
y'[x] = Sin[1/x] - Cos[1/x]/x
And the above expression has no limit as x approaches 0 and Mathematica knows this very well:
Limit[Sin[1/x] - Cos[1/x]/x, x -> 0]
Indeterminate
Limit[y'[x],x->0]
Indeterminate
Also, just taking the definition of derivative (as a limit) at x=0 we would end up with Limit[Sin[1/h],h->0] which of course doesn't exist.
So, I think there is a bug here: when one applies the differentiation operator D to something which has the head of Piecewise it shouldn't differentiate the expression for each condition independently, because the value of a derivative of a function at some point depends not only on the value of the function at that point, but also on all the values of the function in the infinitesimal neighbourhood of that point.