Justifying differentiation of function If a function say $g(x)$ is Continuous such that,

$$
g'(x) = 2x\sin \frac{1}{x} - \cos \frac{1}{x}  , \forall x \neq 0
$$

Will this $g$ be differentiable at $0$ ?

My attempt:
As the $\lim\limits_{x\rightarrow 0} g'(x)$ doesn't exists hence i think the $g$ won't be differentiable at $0$

Is there way to show it or prove otherwise?
Any hint will be appreciated...
For $x \neq 0$ it can be checked by differentiating that

$$
g(x) = \begin{cases}
x^2\sin(1/x) + C &amp; x &gt; 0, \\
x^2\sin(1/x) + D &amp; x &lt; 0,
\end{cases}
$$

where $C$ and $D$ are real constants. Now

$$
\lim_{x \to 0^+} g(x) = C \qquad \text{and} \qquad \lim_{x \to 0^-} g(x) = D,
$$

so for $g$ to be continuous we need $C = D$ and $g(0) = C$. Thus

$$
g(x) = \begin{cases}
x^2\sin(1/x) + C &amp; x \neq 0, \\
C &amp; x = 0.
\end{cases}
$$

We can then calculate

$$
\lim_{x \to 0} \frac{g(x) - g(0)}{x-0} = \lim_{x \to 0} \frac{x^2\sin(1/x)}{x} = \lim_{x \to 0} x\sin(1/x) = 0,
$$

which shows that $g$ is differentiable at $0$ with $g'(0) = 0$.
EDIT my answer regards the question if the function is continuously differentiable ( of class $\bf C^1$ )

The classification of functions into these classes is something you will often when studying more advanced analysis. So this answer attacks the question : 

Is $g$ continously differentiable?

For it to be continously differentiable what we must do is to check that $g'(x)$ is continuous everywhere.

Both $\sin(1/x)$ and $\cos(1/x)$ will oscillate between -1 and 1 faster and faster no matter how small neighbourhood you pick. The first term will therefore be bounded by $|\pm2x|$ which you can prove will be squeezed to 0 but the second one only $|\pm 1|$. 

Depending on the strictness of your course you may want to prove this with $\epsilon-\delta$ or some other method but it will probably be straight forward to do so. So neither left nor right limit for $g'(x)$ will exist for $x=0$, therefore it can not be continuous there. So the function is not in $\bf C^1$