# Extend a continuous function on $(0,\infty)$ to a function on $[0,\infty)$

Which of the following given functions $f:(0,\infty)\rightarrow \mathbb R$ can be extended to become a continuous function on $[0,\infty)$?

1. $\sin{1\over x}$
2. ${1-\cos x}\over x^2$
3. $\cos {1\over x}$
4. $1\over x$

So , continuous extension would require $$\lim_{x\rightarrow 0}f(x)=f(0).$$

Now , among all of them only option $2$ takes a limit while approaching $0$ by L'Hospital's Rule.(being $0\over 0$ form) and that limit is $1\over 2$.So,defining $f(0)={1\over 2}$, this can be extended continuously on $[0,\infty)$. The others do not take limit as $x$ tends to $0.$ so option $2$ is a correct answer.

That is right,yes $?$ As I'm sure about $1\over x$ and $\sin {1\over x}$ not taking limit at $x\rightarrow 0$ , I'm not sure about the function $\cos {1\over x}.$ So , that is why this question.

• $cos(\frac{1}{x})$ and $sin(\frac{1}{x})$ behave very similarly, and both of them go crazy when $x\to 0$.
– Ofir
Dec 18, 2015 at 19:00
• What difference is there (to you) between $\sin 1/x$ at $0$ and $\cos 1/x$ at $0$? Dec 18, 2015 at 19:01
• Your answer is true and the functions in 1, 3 and 4 are discontinuous at zero which is not removable. Dec 18, 2015 at 19:04
• For $\cos {1\over x}$ and $\sin {1\over x}$, take $t:=1/x$ and see what the limits are when $t→∞$.
– Færd
Dec 18, 2015 at 19:04
• @Omnomnomnom : Actually not much difference behavior-wise,. Both are bounded and very near to $0$ their graphs look pretty much the same . Just looked at them . So, all $3$ dismissed.
– user80631
Dec 18, 2015 at 19:05

$\frac{\cos x-1}{x^{2}}$ can be extended to a continuous function on $\mathcal{R}$ because it has a limit at $0$, namely $- \frac{1}{2}$.

We can prove that $$\lim_{x \to 0^+} \cos\frac{1}{x}$$ does not exists by contradiction.

Let: $$\lim_{x \to 0^+} \cos\frac{1}{x}=l$$ chose $\epsilon =\frac{1}{2}$, by the definition of limit we have:

$$\left|\cos\frac{1}{x}-l \right|< \frac{1}{2} \quad if \quad 0<x<\delta \quad \text{for some} \quad \delta >0$$

Now we can allways find an integer $n$ such that $$x'=\frac{1}{2n\pi}<\delta \quad \text{and} \quad x''=\frac{1}{2(n+1)\pi}<\delta$$ and for such $n$ we have: $$\cos\frac{1}{x'}=1 \quad \text{and} \quad \cos\frac{1}{x''}=-1$$this implies that: $$|-1-l|<\frac{1}{2} \quad \text{and} \quad |1-l|<\frac{1}{2}$$ i.e. $$|l+1|<\frac{1}{2}\quad \text{and} \quad |l-1|<\frac{1}{2}$$ and this implies $|1-(-1)|<1$: contadiction!

So the discontinuity at $x=0$ is not removable and you are right also for the question (3).

• I think maybe a better way to say this is that there are two different limits. Boiling it down to the definition of a limit seems to be a bit clunky to me. Dec 18, 2015 at 19:57
• It is not true that there are two different limits. Also the limit form left does not exists ( the proof is substantially the same) and, anyway, the OP asks for the limit from right. Dec 18, 2015 at 20:07
• There are two distinct subsequential limits as evidenced in your post which is very clearly what I meant in my comment. Dec 18, 2015 at 20:08
• What do you means by '' subsequential limits''? Sorry, but this is a terminology that maybe can be useful in english, but that I does not know! Dec 18, 2015 at 20:12
• I guess it's probably a very English-specific term, but a subsequential limit is a limit associated to a subsequence of your original sequence. The term is used a bit more loosely than that in everyday use, though. Dec 18, 2015 at 20:14