Extending $f: (0,1]\mapsto\mathbb{R}$ to a continuous function from $[0,1]$ to $\mathbb R$ Theorem
Consider the continuous function $f: (0,1]\mapsto\mathbb{R}$ defined by $f(x)=\sin(\frac{1}{x}).$ I have to answer the following question :

show that it is impossible to extend this
function to continuous function from
$[0,1]$ to $\mathbb R$

It is not clear to me what is the question asked me to show:
Is it asking me to show that  $\sin(\frac{1}{x})$  is discontinuous ?
If not what is it asking me to do ,exactly?
This question is in the Compactness chapter.Either way best way to prove it
is to use proof by contradiction
PS:I thought of using Intermediate Value Theorem
 A: The thing the question wants you to say is that it is not possible to define $f(0)$ which makes the function continuous on $[0,1]$.
To see that you define $f(0)=r$ say . for arbitrary $r\in\mathbb{R}$
You will get that for $\epsilon=\frac{1}{2}$. You have $\exists \,x$ such that
$|\sin(\frac{1}{x})-r|\geq \frac{1}{2}$ for all $\delta>0$ such that $0<|x|<\delta$.
So you see that no-matter how you define $f(0)$, you will end up with a discontinuity at $x=0$.
A: No, $f(x)=\text{sin}(1/x)$ is of course continuous on $(0,1]$. (not $[0,1]$)
This exercise asking you to show: there is no continuous function $F$ on $[0,1]$, such that $F=f$ on $(0,1]$.
To do this, argument by contradiction, consider $$f(\frac{1}{k\pi})=\text{sin}(k\pi)=0,$$ and $$f(\frac{1}{k\pi+\pi/2})=\text{sin}(k\pi +\pi/2)=1$$ where k is positive integers.
A: To extend a function $f$ is to find a function $g$ such that the domain of $f$ is a subset of the domain of $g$ and $f(x) = g(x)$ over the domain of $f$. To "extend $f$ to X" means to find an extension of $f$ that satisfies condition X. In this case, you're asked to prove that there is no function $g$ that is an extension of $f$, and that is continuous on $[0,1]$. This is tied to the concept of a "removable" discontinuity, which is a discontinuity that can be removed by redefining a function at a particular point. For a discontinuity to be removable, the limit of the function must exist at that point.
A: The problem is asking you to show that $f(0+)$ does not exist. Note that $f(0+) = \lim_{x \to 0 \text{with} x>0} f(x)$. Because the function has wild behavior and does not approach any limit as we approach 0 from the right, such a continuous extension is impossible. Below is a proof sketch.
Suppose for the sake of contradiction that $f(0+)=y_0$. Then, set $\epsilon = \min\{|y_0|/2, (1-|y_0|)/2\}$. Now, for every $\delta>0$ you have to show there exists some $x_0 \in (0, \delta)$ such that $f(x_0) \notin (y_0 - \epsilon, y_0 + \epsilon)$, which contradicts $f(0+)=y_0$.
A: There are already good answers, but since you said that the theme of the chapter is compactness, I'll suggest another idea for a solution.
Any continuous function on a compact metric space (such as $[0,1]$) is uniformly continuous. Show that no matter what value you pick for $f(0)$, $f$ will not be uniformly continuous on $[0,1]$. Hint - if $f$ is uniformly on $[0,1]$, then it is also uniformly continuous on $(0,1]$.
This method might be easier if you do not want to 'think' explicitly about $f(0)$, but only use what you know about $f$ in its original domain.
