Suppose $f$ and $g$ are $\mathcal{S}$-measurable functions from $X\to\mathbb{R}$ and $f(x) >0$ for all $x$. Prove that $(f^g)(x) = f(x)^{g(x)}$ ($f$ to the $g$ power) is a measurable function.
I know that a function is measurable if and only if the inverse image of $(a,\infty)$ belongs to $\mathcal{S}$. But I'm not sure how to use that definition here.
If $a > 0$, then $$\{f^g > a\} = \{g \log(f) > \log(a)\} \in \mathcal{S}$$ since $g$ and $\log f$ are measurable functions.
Also, if $a \leq 0$, then $\{f^g > a\} = X \in \mathcal{S}$
We conclude that $\{f^g > a\}\in \mathcal{S}$ for all $a \in \Bbb{R}$. Hence, $f^g$ is measurable.