Is the function differentiable at $0$? 
Let $$f(x) = \begin{cases}\begin{align*}&\cos{\dfrac{1}{x}}, &x \neq0 \\ &0, &x=0. \end{align*}\end{cases}$$
Is the function $F(x) = \displaystyle \int_{0}^x f dx$ differentiable at $0$?

We can see that the function $f(x)$ is continuous everywhere except $x=0$. In order to show differentiability we will need to show the derivatives from the left and right are equal. So we need to show that $$\lim_{h \to 0^+} \dfrac{F(x+h)-F(x)}{h} = \lim_{h \to 0^-} \dfrac{F(x+h)-F(x)}{h}.$$ The derivative from the right is $$\lim_{h \to 0^+} \dfrac{F(x+h)-F(x)}{h} = \lim_{h \to 0^+} \dfrac{\displaystyle \int_{0}^x\cos{\dfrac{1}{x+h}}-\int_{0}^x\cos{\dfrac{1}{x}}}{h}$$ and the derivative from the left is $$\lim_{h \to 0^-} \dfrac{F(x+h)-F(x)}{h} = \lim_{h \to 0^-} \dfrac{\displaystyle \int_{0}^x\cos{\dfrac{1}{x+h}}-\int_{0}^x\cos{\dfrac{1}{x}}}{h}.$$ I am not sure how to proceed.
 A: The problem is slightly tricky because we don't know the anti-derivative of $\cos (1/x)$ but we do know that function $g(x) = x^{2}\sin(1/x), g(0) = 0$ is continuous and differentiable for all $x$ and $$g'(x) = 2x\sin (1/x) - \cos(1/x),g'(0) = 0$$ and hence $$g(h) = \int_{0}^{h}(2t\sin (1/t) - \cos (1/t))\,dt$$ or $$\int_{0}^{h}\cos(1/t)\,dt = 2\int_{0}^{h}t\sin(1/t)\,dt - g(h)$$ and hence
\begin{align}
F'(0) &= \lim_{h \to 0}\frac{1}{h}\int_{0}^{h}\cos(1/t)\,dt\notag\\
&= \lim_{h \to 0}\frac{2}{h}\int_{0}^{h}t\sin(1/t)\,dt - \frac{g(h)}{h}\notag\\
&= 2\lim_{h \to 0}\frac{1}{h}\int_{0}^{h}t\sin(1/t)\,dt\notag\\
\end{align}
Now $t\sin(1/t)$ has a removable discontinuity at $t = 0$ and its limit is $0$ as $t \to 0$ hence by Fundamental Theorem of Calculus the limit $$\lim_{h \to 0}\frac{1}{h}\int_{0}^{h}t\sin(1/t)\,dt$$ above is $0$ and therefore $F'(0) = 0$.
A: For $x\geq 0$, let $[x]$ denote the largest element of $\mathbb{Z}\pi+\pi/2$ not greater than $x$. 
$$\left|\int_0^x \cos(1/t)dt\right|=\left|\int_{1/x}^\infty \frac{ \cos(t)}{t^2}dt\right|\leq \left|\sum_{n=0}^\infty\int_{[1/x]+n\pi}^{[1/x]+(n+1)\pi}\frac{ \cos(t)}{t^2}dt\right|\leq \left|\int_{[1/x]}^{[1/x]+\pi}\frac{ \cos(t)}{t^2}dt\right|\leq$$
$$\left| [1/x]^{-2}\int_{[1/x]}^{[1/x]+\pi}\cos(t)dt\right|= 2[1/x]^{-2}\leq 2(1/x-\pi)^{-2}\leq cx^{2}$$
for some $c>0$ and all small enough $x$. 
So $|F(x)|$ goes to zero like $x^2$ as $x\rightarrow 0^+$.  So it has a right derivative which is zero. By symmetry the left derivative is also zero. 
A: What you have is the derivative of f, not the derivative of F which is what you want.  The derivative of F at x= 0, from the right, is $\lim_{h\to 0^+}\frac{F(h)- F(0)}{h}= \lim_{h\to 0^+}\frac{\int_0^h f(t)dt}{h}$.
A: Since $\cos(1/x)$ is an even function, it suffices to compute
$$\lim_{h\to0^+}{1\over h}\int_0^h\cos(1/x)\,dx=\lim_{k\to\infty}k\int_k^\infty{\cos x\over x^2}\,dx=\lim_{k\to\infty}\left(-{\sin k\over k^2}-k\int_k^\infty{\sin x\over x^3}\,dx \right)$$
Now $\lim_{k\to\infty}(\sin k/k^2)=0$ and
$$\left|k\int_k^\infty{\sin x\over x^3}\,dx \right|\le k\int_k^\infty{dx\over x^3}={k\over2k^2}={1\over2k}\to0$$
It follows that $F'(0)=0$.
