# how to show that this function is continuous for all real numbers?

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$.

• Please see the following to typeset your questions in $\LaTeX$: meta.math.stackexchange.com/questions/5020/… Jan 30, 2015 at 9:37
• For your first question, just use basic theorems: the composition of continuous functions is continuous and the product of continuous functions is continuous. Also, you just need to show continuity at each point $x$. You've handled $x=0$... Jan 30, 2015 at 9:38
• thank you, but I don't understand what you mean. It would be much appreciated if you would explain that with equation Jan 30, 2015 at 9:41
• If $a\ne0$, then $s(x)=\sin x$, $g(x)=1/x$, and $h(x)=x^2$ are continuous at $x=a$. The composition of continuous functions is continuous (you should have this fact in hand), so $s\circ g$ is continuous at $x=a$. The product of continuous functions is continuous, so $h(s\circ g)$ is continuous at $x=a$. But $h(s\circ g)$ is your function $f$. Jan 30, 2015 at 9:50
• Oops, I meant "your function $g$" above. Jan 30, 2015 at 9:58

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.

You can show both are continuous at $0$ using squeeze theorem. For example let's see (a),

$$-x^2\leq x^2 \sin{\frac{1}{x}}\leq x^2$$

Since both $x^2$ and $-x^2$ go to zero when $x\rightarrow 0$, by squeeze theorem, $\sin{\frac{1}{x}} \rightarrow 0$. Part (b) can be done similarly.