Let $I = [0,1]\setminus \mathbb{Q}$, the set of irrationals in the unit interval.
Partition $I$ into countably many nonempty pieces, each given by the intersection of an open set in $[0,1]$ and $I$, such that $I = \cup_{k=0}^\infty I_k$. For example,
$I_0 = \left(\frac{1}{2},1\right) \cap I$,
$I_1 = \left(\frac{1}{4},\frac{1}{2}\right)\cap I$,
and in general $I_k = \left(\frac{1}{2^{k+1}},\frac{1}{2^k}\right)\cap I$. Note that each $I_k$ is open in $I$.
Enumerate $\mathbb{Q} \cap [0,1]$ (in any way you like): $\{q_0, q_1, q_2,\dots\}$.
For any $x\in I$, $x\in I_k$ for exactly one $k$. Define $f(x) = q_k$.
Note that $f$ is surjective, since each $I_k$ is nonempty.
We want to show that $f$ is continuous. Let $O\subseteq \mathbb{Q}\cap [0,1]$ be an open set. We can write $O = \bigcup_{q_k\in O} \{q_k\}$.
$$f^{-1}[O] = \bigcup_{q_k\in O}\,f^{-1}[\{q_k\}] = \bigcup_{q_k\in O} I_k.$$
This is a union of open sets in $I$, so it is open.
Note that we didn't actually use that $O$ was an open set: our function $f$ is continuous even if we give $\mathbb{Q}$ the discrete topology!
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$.
Best Answer
HINT: Show that a continuous injection is either order preserving or order reversing.