[Math] how to show that this function is continuous for all real numbers

calculuslimits

I'm having hard time playing with trigonometric functions.

I want to show that this piecewise function is continuous for all real numbers (from $-\infty$ to $\infty$)

a) $g(x)=$

\begin{cases}
x^2\sin{\frac{1}{x}}, & \text{if $x\ne 0$} \\
0, & \text{if $x=0$}
\end{cases}

and is the function

b) $f(x)=$

\begin{cases}
2x\sin{\frac{1}{x}}\cos{\frac{1}{x}} , & \text{if $x\ne 0$} \\
0, & \text{if $x=0$}
\end{cases}

continuous at $x = 0$?

So for the first one, I think its continuous at $x = 0$ since the range of $\sin{\frac{1}{x}}$ is between $-1$ and $1$, while $x^2\rightarrow 0$. But I'm not sure how I should show that the function is continuous from $(-\infty,\infty)$ using $\frac{f(x+h)-f(x)}{h}$ definition..

I think the derivative of $g(x)$ is $f(x)$ but i'm not sure whether it is continuous at $0$.

Can anyone please clarify this??

Best Answer

Concerning $g(x)$: $g(x)$ can be seen as $g(x)=f_1(x)f_2(f_3(x))$ where $f_1(x)=x^2$, $f_2(x)=sin(x)$ and $f_3(x)=\frac{1}{x}$, $f_1,f_2,f_3$ are continuous $\forall x \ne 0$, it means that $g(x)$ being a product/ composition of continuous functions is continuous $\forall x \ne 0$.

Then $-x^2 \le g(x) \le x^2$ because $-1 \le sin(x) \le 1$ $\forall x$, moreover $\lim_{x \to 0} x^2=\lim_{x \to 0} -x^2=0$ $\implies$ $\lim_{x \to 0} g(x)=0=g(0)$, so $g(x)$ is continuous also for $x=0$.

Will you try the second problem yourself now?

Concerning $(f(x+h)−f(x))/h$ "definition": please make sure for yourself that you do not confuse related but still different ideas of a continuous and differentiable function.