$\varphi(x)$ will be continuous at $x=0$ when $\varphi(0^+)$ = $\varphi(0^-)$ = $\varphi(0)$
$\varphi(0^+) = \lim_{x\rightarrow 0^{+}}\varphi(x)$ = $\lim_{h\rightarrow 0}\varphi(0+h)$ = $h^{2}cos\left ( \frac{1}{h} \right )$
$\lim_{h\rightarrow 0}cos\left ( \frac{1}{h} \right )$ is undefined because it does not converge to a singe value, It is b/w $-1$ and $+1$
According to Sandwich Theorem ,
If $g(x) ≤ f(x) ≤ h(x)$ and $g(x)$ and $h(x)$ both approach L as x approaches a, then f(x) must also approach L as x approaches a.
So, here , $−1 \leqslant cos\left ( \frac{1}{h} \right ) \leqslant 1$
Since, $h^2 \geq 0$
So,
$-h^{2} \leqslant h^{2}cos\left ( \frac{1}{h} \right )\leqslant +h^{2}$
Since, both $-h^2$ and $h^2$ approaches zero when $h$ approaches zero
So, $h^{2}cos\left ( \frac{1}{h} \right )$ will also approaches zero when $h$ approaches zero.
Hence, $\varphi(0^+) = h^{2}cos\left ( \frac{1}{h} \right ) = 0$
Now, $\varphi(0^-) = \lim_{x\rightarrow 0^{-}}\varphi(x)$ = $\lim_{h\rightarrow 0}\varphi(0-h)$ = $h^{2}cos\left ( \frac{1}{(-h)} \right ) = h^{2}cos\left ( \frac{1}{h} \right ) = 0$
It is given that $\varphi(0) = 0$
So, $\varphi(0^+)$ = $\varphi(0^-)$ = $\varphi(0)$
So, $\varphi(x)$ will be continuous at $x=0$
Now, for Differentiability,
1) Left Hand Derivative(LHD) = $f'(x_{0}^{-}) = \lim_{x\rightarrow x_{0}^{-}} \frac{f(x) - f(x_{0})}{x-x_{0}}$
(or) we can write it as :-
$f'(x_{0}^{-}) = \lim_{h\rightarrow 0} \frac{f(x_{0} - h) - f(x_{0})}{x_{0}- h -x_{0}} = \lim_{h\rightarrow 0} \frac{f(x_{0} - h) - f(x_{0})}{-h}$
2) Right Hand Derivative(RHD) = $f'(x_{0}^{+}) = \lim_{x\rightarrow x_{0}^{+}} \frac{f(x) - f(x_{0})}{x-x_{0}}$
(or) we can write it as :-
$f'(x_{0}^{+}) = \lim_{h\rightarrow 0} \frac{f(x_{0} + h) - f(x_{0})}{x_{0}+ h -x_{0}} = \lim_{h\rightarrow 0} \frac{f(x_{0} + h) - f(x_{0})}{h}$
So, Here, LHD = $\lim_{h\rightarrow 0} \frac{f(-h) - f(0)}{-h} = \frac{h^2cos\left ( \frac{1}{-h} \right )}{-h} = -hcos\left ( \frac{1}{h} \right ) = 0$
RHD = $\lim_{h\rightarrow 0} \frac{f(h) - f(0)}{h} = \frac{h^2cos\left ( \frac{1}{h} \right )}{h} = hcos\left ( \frac{1}{h} \right ) = 0$
Since, LHD=RHD, So, $\varphi(x)$ is differentiable at $x=0$