Let $p$ be a prime number, and $S = [0,1] \cap \left \{\frac {q} {p^n}\ \bigg |\ q \in \Bbb Z, n \in \Bbb Z_{\geq 0} \right \}.$ Assume that $S$ has the subspace topology induced from the inclusion $S \subseteq [0,1].$ Is it true that a bounded continuous function on $S$ uniquely extends to a bounded continuous function on $[0,1]\ $?
It is clear that $S$ is dense in $[0,1].$ For a given $\alpha \in [0,1]$ we could have taken the sequence $\left \{ \frac {\left \lfloor {p^n \alpha} \right \rfloor} {p^n} \right \}_{n \geq 1} \subseteq S$ converging to $\alpha.$ So the question boils down to $:$ "Can every bounded continuous function on $S$ uniquely extend to a bounded continuous function on $\overline S\ $?" If the boundedness condition is removed then the answer is clearly no. For instance we could have taken the function $f : S \ni x \longmapsto \frac {1} {x - \alpha} \in \Bbb R,$ for $\alpha \in [0,1] \setminus S.$ Then it has no continuous extension on $[0,1].$ But it is clear that if the extension of a continuous function exists on the closure of it's domain then it is unique. So the question is $:$
Does there exist a bounded continuous function on $S$ which doesn't have any continuous extension on $\overline {S}\ $?
Can anybody come up with a counter-example? A small hint is required at this stage.
Thanks in advance.
Define$$\begin{array}{rccc}f\colon&S&\longrightarrow&\Bbb R\\&x&\mapsto&\begin{cases}0&\text{ if }x<\frac1{\sqrt2}\\1&\text{ otherwise.}\end{cases}\end{array}$$Then $f$ is continuous and bounded, but it cannot be extended to a continuous function on $[0,1]$.