One of the logarithmic inequalities says: $$\frac{x}{1+x} < \ln (1 + x) < x, \forall x > -1$$
Because $\lim\limits_{x\rightarrow a} f(x)=0$, then $f(x)>-1$, for all $x$ in some vicinity of $a$. So $$\frac{f(x)}{1+f(x)} < \ln (1 + f(x)) < f(x)$$ from all $x$ in some vicinity of $a$. As a result $$\lim_{x \rightarrow a} \left ( 1 + f(x) \right )^{\frac{1}{f(x)}}=e$$
Alternatively (let's limit to the case when $g(x)>0$)
$$\frac{f(x) \cdot g(x)}{1+f(x)} < g(x) \cdot \ln (1 + f(x)) < f(x)\cdot g(x)$$
($e^{x}$ is ascending $\forall x$)
$$e^{\frac{f(x) \cdot g(x)}{1+f(x)}} < (1 + f(x))^{g(x)} < e^{f(x)\cdot g(x)}$$
Or
$$\frac{e^{\frac{f(x) \cdot g(x)}{1+f(x)}}}{e^{f(x)\cdot g(x)}} < \frac{(1 + f(x))^{g(x)}}{e^{f(x)\cdot g(x)}}<1$$
Or
$$0 < \frac{1}{e^{f(x) \cdot g(x) \cdot \frac{f(x)}{1+f(x)}}} < \frac{(1 + f(x))^{g(x)}}{e^{f(x)\cdot g(x)}}<1 \tag{*}$$
Now a little summary:
- if $g(x)$ is bounded (at least in some vicinity of $a$), then $\mathbf{(*)}$ is asymptotic to $1$ when $x\rightarrow a$.
- same is true if $g(x)$ happens to be continuous in a vicinity of $a$.
Not totally sure about the $\lim\limits_{x\rightarrow a} g(x)=\infty $ case. I would say, it depends.