Prove $g(x)= \{x^2 \sin \left(\frac1x\right);x\neq 0$ and $g(0)=0$
is not uniformly continuous
so I know g is continuous at $0$. However, I think $g$ isn't uniformly continuous based on the graph. I thinking I want to find a cauchy sequence that $g$ doesn't preserve. Another option would be to find two sequences that converge, but whose images don't.
The function $g$ is continuous. Therefore it is uniformly continuous on any compact set.
Now consider the interval $[1,\infty)$. The derivative is
$$g'(x) = 2x\sin\left(\frac1{x}\right) - \cos\left(\frac1{x}\right).$$
Then
$$|g'(x)| \leq 2\left|x\sin\left(\frac1{x}\right)\right| + \left|\cos\left(\frac1{x}\right)\right| \leq 2\left|x\sin\left(\frac1{x}\right)\right|+1.$$
Note that for $0 \leq y \leq 1$,
$$\left|\frac{\sin\left(y\right)}{y}\right|\leq 1.$$
Hence for $x \geq 1$,
$$\left|x\sin\left(\frac1{x}\right)\right|= \left|\frac{\sin\left(\frac1{x}\right)}{\frac1{x}}\right| \leq 1.$$
Therefore
$$|g'(x)| \leq 2\left|x\sin\left(\frac1{x}\right)\right|+1 \leq 3.$$
Since $g$ has a bounded derivative on $[1,\infty)$ it is uniformly continuous there.
Make a similar argument for $(-\infty,-1]$. Then it is easy to show that $g$ is uniformly continuous on $\mathbf{R} = (-\infty,-1] \cup [-1,1] \cup [1,\infty).$