Find $m$ if $f(x)=x^m\sin\frac{1}{x}$ is continuous and is not differentiable If $f(x)=\begin{cases}
x^m\sin\dfrac{1}{x}, & x\ne 0 \\
0, & x=0   
\end{cases}$.
Find $m$ if $f(x)$ is continuous and is not differentiable
My attempt is as follows:-
Let's find the condition of continuity 
$$\lim_{x\to0^{+}}x^m\sin\dfrac{1}{x}$$
As $x\rightarrow 0^{+}, \dfrac{1}{x}\rightarrow \infty,\sin\dfrac{1}{x} \text { oscillates in }  [-1,1]$
$$m>0$$
$$\lim_{x\to0^{-}}x^m\sin\dfrac{1}{x}$$
As we have the negative base
$$m>0 \cap m\notin \left\{\dfrac{p}{q} | p,q \text { are coprime and } q \text { is even }\right\}\tag{1}$$
Let's find the condition of non-differentiability
$\lim_{h\to 0}\dfrac{h^m\sin\dfrac{1}{h}}{h}$ should not exist
$$\lim_{h\to 0^{+}}h^{m-1}\sin\dfrac{1}{h}$$
$$m\le0$$
$$\lim_{h\to 0^{-}}h^{m-1}\sin\dfrac{1}{h}$$
$$m-1\le 0 \cup m-1\in\left\{\dfrac{p}{q} | p,q \text { are coprime and } q \text { is even }\right\}$$
$$m\le 1 \cup m\in\left\{\dfrac{p+q}{q} | p,q \text { are coprime and } q \text { is even }\right\}\tag{2}$$
Taking intersection of equations $(1)$ and $(2)$
$$\left(m\in(0,1] \cap m\notin \left\{\dfrac{p}{q} | p,q \text { are coprime and } q \text { is even }\right\}\right) \cup  \left(m>0 \cap m\notin \left\{\dfrac{p}{q} | p,q \text { are coprime and } q \text { is even }\right\} \cap m\in\left\{\dfrac{p+q}{q} | p,q \text { are coprime and } q \text { is even }\right\}\right)$$
But actual answer is simply $m\in(0,1]$

I'd do cases: clearly $\;m>0\;$, otherwise you have $\;\frac1{x^n}\sin\frac1x\;$ , with positive $\;n\;$ , and thus the limit doesn't exist as 
$$\;\frac1{x^n}\xrightarrow[x\to 0^\pm]{}\pm\infty\;\;\text{and}\;\;\lim_{x\to 0}\sin\frac1x\;\;\text{doesn't exist}$$
Now, for $\;0\le m\le1\;$ , we get that 
$$\lim_{x\to0} x^m\sin\frac1x=0\;\;\text{since sine is bounded, but}\;\;f'(0)=\lim_{x\to0}\frac{x^m\sin\frac1x}x=\lim_{x\to0}x^{m-1}\sin\frac1x$$
and this last limit doesn't exist by the reasons above as $\;m-1\le0\;$. 
Thus, it must be $\;m>1\;$ , and then
$$f'(0)=\lim_{x\to0}x^{m-1}\sin\frac1x=0\;,\;\;\text{ since}\;\;m-1>0$$
