Lagrange's Mean Value Theorem - contradiction with a limit? Consider the function given by $$f(x)=x^2\sin\frac{1}{x}$$ for all $x\neq 0$ and $$f(0)=0.$$
As this function is differentiable for every $x\in\Bbb R$, we can use Lagrange's Mean Value Theorem: For every $x\in\Bbb R$, there is a $\delta_x\in]0,x[$ such that
$$x^2\sin\frac{1}{x}=x(2\delta_x \sin\frac{1}{\delta_x}-\cos \frac{1}{\delta_x})$$ whereas 
$$\cos\frac{1}{\delta_x}=2\delta_x \sin\left(\frac{1}{\delta_x}\right)-x\sin\frac{1}{x}$$ Now as $x$ tends to $0$, $\delta_x$ also tends to $0$. Passing to the limit, we obtain $$\lim_{x \to 0}\cos\frac{1}{\delta_x}=0,$$ whereas it is known that $$\lim_{\delta \to 0}\cos\frac{1}{\delta}$$ does not exist.
My question. Where is the mistake in my argumentation?

You have to read it a little bit different
You know, that $\forall_{x > 0} \exists_{\delta(x) \in (0,x)} $, such that $ \cos(\frac{1}{\delta(x)}) = 2\delta(x)\sin(\frac{1}{\delta(x)}) - x\sin(\frac{1}{x}) $
Now, as you pointed out, while $x\to 0^+$, then because $\delta(x) \in (0,x) $, then $\delta(x) \to 0^+$, too.
There exists a limit of RHS and is equal to $0$ as you claim. But that doesn't mean that there exists $\lim_{x \to 0^+} \cos(\frac{1}{x}) $. We only know, that for a sequence $\{ x_n\}_{n\in \mathbb N}$ tending to $0$, there exists a sequence $\{ \delta(x_n) \}_{n \in \mathbb N }$ tending to $0$, such that $\lim_{n \to \infty} cos(\frac{1}{\delta(x_n)}) = 0$
