One way to "foresee" it is that there are clearly two lines in the first image you posted that serve as an envelope to $f(x)$. These two lines crossing at the origin make it impossible to approximate $f$ near $x=0$ as a linear function. This is the criterion of differentiability you want to keep in mind when trying to make this kind of judgement.
On the other hand, in the second image, the envelope is two parabolas touching at the origin. Since the parabolas are tangent at the origin, they force $y=0\cdot x$ to be the only way to approximate $f(x)$ as a linear function near $x=0$.
In the end, the criterion for differentiability of functions squeezed inside an envelope $$e_-(x)\leq f(x)\leq e_+(x)$$ is: no matter how wildly $f(x)$ oscillates inside the envelope, $f(x)$ will be differentiable at $x=0$ if (i) the envelopes touch each other: $$e_-(0)=e_+(0)$$ that is, they do squeeze $f(x)$ appropriately; and (ii) they are both differentiable with equal derivatives: $${e'}_{\!-}(0)={e'}_{\!+}(0)$$ thus forcing $f(x)$ to be differentiable with the same derivative.
The function defined by
$$f(x)=\begin{cases}\frac{\sin(x)}{x}&,x\ne 0\\\\1&,x=0\end{cases}$$
is not only differentiable at $x=0$, it is continuously differentiable there.
NOTE:
I thought it would be instructive to present a way forward that relies only on a standard, elementary inequality and the squeeze theorem. To that end, we proceed.
The derivative at $x=0$ is given by
$$f'(0)\equiv \lim_{h\to 0}\frac{\frac{\sin(h)}{h}-1}{h} \tag 1$$
Recalling from elementary geometry that the sine function satisfies the inequalities
$$\cos(h) \le \frac{\sin(h)}{h}\le 1 \tag 2$$
for $|h|\le \pi/2$, we see that the term under the limit in $(1)$ satisfies the inequalities
$$-2\sin^2(h/2)= \cos(h)-1\le \frac{\sin(h)}{h}-1\le 0 \tag 3$$
Then, taking absolute values, dividing by $|h|$, and using the right-hand side inequality in $(2)$ yields
$$0 \le \left|\frac{\frac{\sin(h)}{h}-1}{h}\right|\le \frac12 |h| \tag 4$$
whereupon applying the squeeze theorem to $(4)$ produces the limit
$$\lim_{h\to 0}\frac{\frac{\sin(h)}{h}-1}{h}=0$$
Therefore, $f'(0)=0$.
For $x\ne 0$, we have
$$f'(x)=\frac{x\cos(x)-\sin(x)}{x^2}$$
To see that $f'(x)$ is continuous at $x=0$, we need to show that
$$\lim_{x\to 0}\frac{x\cos(x)-\sin(x)}{x^2}=0 $$
Again, using $(2)$ we see that
$$0\le \left|\frac{x\cos(x)-\sin(x)}{x^2}\right|\le\left|\frac{1-\cos(x)}{x}\right| \le \frac12 |x| \tag 5$$
whereupon applying the squeeze theorem to $(5)$ produces the limit
$$\lim_{x\to 0}\frac{x\cos(x)-\sin(x)}{x^2}=0 $$
Therefore,
$$\lim_{x\to 0}f'(x)=0=f'(0)$$
which shows that $f'$ is continuously differentiable at $0$.
Best Answer
Firstly, for any non zero $x$, $f$ is diffrentiable. It is easy to prove. now, I am trying to prove for $x=0$.
$$f^{\prime}(0)=\lim_{x\to 0}\frac{x^2\sin(\frac{1}{x^2})}{x}=\lim_{x\to 0} x\sin(\frac{1}{x^2}).$$
Now, $RHL=\lim_{x\to 0^+} x\sin(\frac{1}{x^2})=0$ and $LHL=\lim_{x\to 0^-} x\sin(\frac{1}{x^2})=0$.
(Since $\sin(\frac{1}{x^2})$ is a bounded function so the limit is $0$ as $x\to 0$.)
Since both limits are equal, $f$ is differentiable at $x=0$.
Basically, $f$ is diffrentiable on $[0,1]$, but $f^{\prime}$ is not continious at $x=0$.