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]$
 A: 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$. 

A: 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$$
A: The funcion $f$ is differentiable at $0$ if and only if the limit$$\lim_{x\to0}\frac{f(x)-f(0)}x\tag1$$exists. But, since $f(0)=0$, the assertion that the limit $(1)$ exists is equivalent to the assertion that the limit$$\lim_{x\to0}x^{m-1}\sin\left(\frac1x\right)$$exists. And this happens if and only if $m-1>0$.
A: Your approach in correct in all aspects except your considering fractional powers with even denominators as base. The original question does not imply any condition to the domain of the function, it asks you to define a function. The domain is defined after you define the function. Here, you need not necessarily take the domain as $\Bbb R$.
In those functions with $m\in \left\{\dfrac{p}{q} | p,q \text { are coprime and } q \text { is even }\right\}$, the domain would be simply defined as $\Bbb R^{+}\cup \{0\}$ , and in that case continuity and differentiability would be checked from the right side. See:- for limit at end point of domain.
And those functions will not pose any problem to the conditions given question.
