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 have to admit I cannot really understand what you are trying to do, and how you come with your conditions for $p$ and $q$. 
The first condition is that you need 
$$
\lim_{x\to0} x^m\sin\frac1x=0. 
$$
Since the sine is bounded, when $m>0$ we have $\left|x^m\sin\frac1x\right|\leq|x|^m$, so the limit is $0$ and the function is continuous. When $m\leq0$ the function oscilates at $0$ (unboundedly if $m<0$ so the limit doesn't exist). 

So far: continuity when $m>0$. 

For differentiability, we look at the limit at $0$ of 
$$
\frac {x^m\sin\frac1x}{x}=x^{m-1}\sin\frac1x.
$$
If $m>1$, the limit is zero and so $f$ will be differentiable. When $m<1$, let $x_k=\frac2{\pi(2k+1)}$. Then 
$$
x_k^{m-1}\sin\frac1{x_k}=\left(\frac{\pi(2k+1)}{2}\right)^{1-m}\xrightarrow[k\to\infty]{}\infty
$$
since $m<1$ so $1-m>0$. And when $m=1$ the limit is $1$ we can also choose a sequence so that the limit doesn't exist.
Thus $f$ is differentiable precisely when $m>1$. So,

$f$ is continuous but not differentiable when $0<m\leq 1$. 

