Solution 1:

The rules of differentiation work for the points you already know the function is differentiable; the function $|x|$ is differentiable if $x \ne 0$ and its derivative for $x \ne 0$ is $\frac{x}{|x|}$, and $\sin(x^2)$ is differentiable for any $x \in \mathbb{R}$. So, for the theorem of differentiability of a product, their product is differentiable for any $x\ne0$ and the derivative is given by the formula you've already written. However, for $x = 0$ no theorems guarantee the differentiability a priori for $f$ (because of the presence of $|x|$), so you must use the definition for $x=0$.

That is, you must evaluate $f'(0)$, if it exists, with the limit of the difference quotient: $$f'(0)=\lim_{h \to 0} \frac{f(0+h)-f(0)}{h}=\lim_{h\to 0} \frac{f(h)}{h}=\lim_{h \to 0} \frac{|h|\sin(h^2)}{h}=\lim_{h \to 0} \frac{|h|\cdot[h^2+\text{o}(h^2)]}{h}=0$$ Hence $$f'(x)=\begin{cases}\frac{x}{|x|}\sin(x^2)+2x|x|\cos x, \ \text{if} \ x \ne 0\\ 0, \ \text{if} \ x=0\end{cases}$$

Notice that another ways to write the derivative of $|x|$ for $x \ne 0$ is $\frac{|x|}{x}$ or $\text{sgn}(x)$, where $$\text{sgn}(x)=\begin{cases}1, \ \text{if} \ x > 0\\ 0, \ \text{if} \ x =0,\\ -1, \ \text{if} \ x<0\end{cases}$$