Extension of a bounded continuous function on $[0,1].$ 
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.
 A: 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]$.
A: Such a function exists under very general conditions.
It can be shown that on any non-compact metric space without isolated points there is a bounded continuous function which is not uniformly continuous. [This result has appeared before on this site]. This applies to your set $S$ and a continuous function $f$ on $S$  which is not uniformly continuous cannot be extended to a continuous function on $[0,1]$.
For ease of reference I have included a proof of the result I have quoted above:
Theorem: If $(X,d)$ is a metric space with at most finitely many isolated points such that every bounded continuous real function on it is uniformly continuous then $X$ is compact.
Suppose $X$ has a sequence $\{x_{n}\}$ with no convergent subsequence.
Choose positive numbers $\delta _{n},n=1,2,...$ such that $B(x_{n},\delta
_{n})$ does not contain any $x_{m}$ with $m\neq n$ and $\delta _{n}<\frac{1}{%
n}$ $\forall n.$ Since $x_{n}$ is not an isolated point for $n$ sufficiently
large (say, for $n\geq N$) we can find distinct points $x_{n,m},m=1,2,...$
in $B(x_{n},\delta _{n})\backslash \{x_{n}\}$ converging to $x_{n}$ as $%
m\rightarrow \infty $ (for $n=N,N+1,...$). We may suppose $d(x_{n,m},x_{n})<%
\frac{1}{n}$ $\forall n,m.$ Let $A=\{x_{n,n}:n\geq N\}$ and $B=\{x_{n}:n\geq
N\}$. Claim: $A$ is closed. Suppose $x_{n_{j},n_{j}}\rightarrow y$. Then $%
d(y,x_{n_{j}})\leq
d(y,x_{n_{j},n_{j}})+d(x_{n_{j},n_{j}},x_{n_{j}})<d(y,x_{n_{j},n_{j}})+%
\delta _{n_{j}}\rightarrow 0$. Thus $x_{n_{j}}\rightarrow y.$ Since $%
\{x_{n}\}$ has no convergent subsequence it follows that $\{n_{j}\}$ is
eventually constant and hence $y=\underset{j}{\lim }$ $x_{n_{j},n_{j}}$
belongs to $A.$ Clearly $B$ is also closed. Further, $A\cap B=\emptyset $.
Let $f:X\rightarrow \lbrack 0,1]$ be a continuous function such that $%
f(A)=\{0\}$ and$\ f(B)=\{1\}$. By hypothesis $f$ is uniformly continuous.
Note that $d(A,B)\leq d(x_{n},x_{n,n})<\frac{1}{n}$ $\forall n.$ Thus $%
d(A,B)=0$ and, by uniform continuity, $d(f(A),f(B))=0.$ This contradicts the fact
that $f(A)=\{0\}$ and$\ f(B)=\{1\}$. This contradiction shows that $X$ is
compact.
A: Here is a continuous function $x\mapsto \sin \frac{1}{x}$ on $(0,1]$ with no continuous extension to $[0,1]$.
