How to prove that the function $f$ is continuous on $\mathbb{R}$ Let
$$f:\mathbb{R}\to \mathbb{R} : f(x)=\begin{cases} a^x &amp; \text{if $x \in \mathbb{Q}$} \\ \sup\{ f(y):y&lt;x \text{ and }y \in \mathbb{Q} \} &amp; \text{if $x \in \mathbb{R} \setminus \mathbb{Q}$}\end{cases}$$ where $a&gt;0$. 

Prove that $f$ is continuous on $\mathbb{R}$.
Hint: Use $f(x+y)=f(x)f(y)$ for $x,y\in\Bbb Q$ and $f(x)\approx 1$ for $0\approx x\in\Bbb Q$.
If $a \geq 1$ there is nothing to prove as $f(x)=a^x$, $\forall x$ by conitnuity of $a^x$ and the fact that $\mathbb{Q}$ is dense in $\mathbb{R}$. 
So let $a &lt;1$. If $a &lt; 1$ then $f(x) = \infty$ for $x &gt; 0$ and $x \in \mathbb{R} \setminus \mathbb{Q}$ and $f$ is not continuous as let $a=1/2$. $\sup\{(1/2)^y : y &lt; x,y \in \mathbb{Q}\} \geq \lim_{n \rightarrow \infty} (1/2)^{(-n)} = \infty$.