Differentiability question ends up in contradiction. Let $f(x)=x^3cos\frac{1}{x}$ when $x\neq0$ and $f(0)=0$.
Is $f(x)$ differentiable at $x=0$?

My first attempt
Definition: A function is differentiable at $a$ if $f'(a)$ exists.
$$f'(x)=\lim_{h \to 0}\frac{f(x+h)-f(x)}{x+h-x}$$
$$f'(0)=\lim_{h \to 0}\frac{f(h)-f(0)}{h}$$
since $f(0)=0$
$$f'(0)=\lim_{h \to 0}\frac{f(h)-0}{h}$$
$$f'(0)=\lim_{h \to 0}\frac{h^3cos\frac{1}{h}}{h}$$
$$f'(0)=\lim_{h \to 0}h^2cos\frac{1}{h}$$
We know that $-1\leq cos(a) \leq 1$ for any real number $a$, so this implies:
$$-h^2 \leq h^2cos\frac{1}{h} \leq h^2$$
were both the lower and upper bounds approach $0$ when $h$ approaches $0$, therefore this seems to imply that a limit exists for $f'(0)$ and it is precisely $0$. So therefore $f(x)$ is differentiable at $0$.

But my second attempt results in a different answer.
$$f'(x)=3x^2cos\frac{1}{x}-xsin\frac{1}{x}$$
$cos\frac{1}{0}$ is undefined but since $f(0)=0$ if we could get the terms to be expressed in terms of $x^3cos\frac{1}{x}$ then maybe that is defined:
$$f'(x)=3\frac{x^3cos\frac{1}{x}}{x}-\frac{x\sqrt{x^6-x^6cos^2\frac{1}{x}}}{x^3}$$
since $f(0)=0^3cos\frac{1}{0}=0$
$$f'(0)=\frac{0}{0}-0$$
which is undefined.

So there lies my contradiction.
I think my questionable step is assuming that $f(0)=0 \implies 0^3cos\frac{1}{0}=0$
How do I solve this contradiction and determine whether $f'(0)$ is differentiable?

$1$) You showed correctly, from the definition of the derivative, that $f'(0)=0$. 
$2$) You used the ordinary differentiation formula to find the derivative of $f(x)$ when $x\ne 0$. That is perfectly fine.
Then you decided to use the limit as $x\to 0$ of the $f'(x)$ calculated in $2$) to calculate $f'(0)$. That is in principle not OK. This limit exists and is equal to $f'(0)$ precisely if $f'(x)$ is continuous at $x=0$. In our case, $f'(x)$ happens to be continuous at $x=0$. However, let $g(x)=x^2\sin(1/x)$ when $x\ne 0$, and let $g(0)=0$. Then it turns out that $g(x)$ is differentiable everywhere, but $g'(x)$ is not continuous at $x=0$. 
Remark: It turns out that $\lim_{x\to 0}f'(x)=0$. However, your particular manipulation did not show this. We give a simillar but more extreme example. Let $h(x)=e^x$. Of course $\lim_{x\to 0} h(x)=1$. But note that if $x\ne 0$, then $h(x)=\frac{x^3e^x}{x^3}$. If we set $x=0$, we get an undefined result. That's not a problem: setting $x=0$ is just not the right way to calculate the limit.   
