Find all functions $f$ such that $f(x)\sin(1/x)$ continuous at $x_0 = 0$ A high-school problem. There is a mistake with the problem setting since $f(x)\sin(1/x)$ is undefined at $x=0$. You may alternatively use the limit here. The problem would thus become finding all functions $f$ such that $\lim_{x\to 0} f(x)\sin(1/x)$ exists.

Let $g(x)=f(x)\sin\frac{1}{x}$ and $g(0)=0.$
We show that $$g(x)=x^2\sin\frac{1}{x}$$ is continuous at $x=0.$.
We find $\lim_{x\to 0} g(x)=0$ by sandwich theorem by noting that
$$-x^2\le x^2\sin \frac{1}{x}\le x^2\implies \lim_{x \to 0} -x^2= \lim_{x \to 0} x^2 \sin \frac{1}{x}=\lim_{x\to 0} x^2$$
Next,  $$\frac{dg(x)}{dx}=\lim_{h \to 0} \frac{h^2\sin \frac{1}{h}-0}{h}=\lim_{h\to 0} h \sin \frac{1}{h}=0, $$
by sandwich theorem as
$$-x\le x\sin \frac{1}{x}\le x\implies \lim_{x \to 0} -x= \lim_{x \to 0} x \sin \frac{1}{x}=\lim_{x\to 0} x=0.$$
Hence $g(x)$ when $f(x)=x^2$ is both continuous and differentiable at $x=0.$
