For $x,y\in\mathbb{R}$ and $m,n\in\mathbb{Z}$,
$$
\eqalign{
g(x+y)=g(x)\,g(y)
&\implies
g(x-y)={g(x) \over g(y)}
\\&\implies
g(nx)=g(x)^n
\\&\implies
g\left(\frac{m}nx\right)=g(x)^{m/n}
}
$$
so that $g(0)=g(0)^2$ must be one (since if it were zero, then $g$ would be identically zero on $\mathbb{R}$), and with $a=g(1)$, it follows that $g(r)=a^r$ for all $r\in\mathbb{Q}$. All we need to do now is invoke the continuity of $g$ and the denseness of $\mathbb{Q}$ in $\mathbb{R}$ to finish.
For example, given any $x\in\mathbb{R}\setminus\mathbb{Q}$, there exists a sequence $\{x_n\}$ in $\mathbb{Q}$ with $x_n\to x$ (you could e.g. take $x_n=10^{-n}\lfloor 10^nx\rfloor$ to be the approximation of $x$ to $n$ decimal places -- this is where we're using that $\mathbb{Q}$ is dense in $\mathbb{R}$). Since $g$ is continuous, $y_n=g(x_n)\to y=g(x)$. But $y_n=a^{x_n}\to a^x$ since $a\mapsto a^x$ is also continuous.
Moral: a continuous function is completely determined by its values on any dense subset of the domain.