Likelihood ratio as Radon-Nikodym derivative 
I have a question regarding Exercise 6.11, displayed above. We assume that $\mathbb{P}^{X}(E):=\mathbb{P}(X \in E)$ for $E\in\mathcal{B}^n$.
I wanted to prove that last assertion and, by doing the computations backwards, I arrive at
\begin{align*}
\frac{f(X(\omega))}{g(X(\omega))}
&=\left(\frac{f}{g}\right)(X(\omega)) \\
&=\frac{\text{d}\mathbb{P}^X}{\text{d}\mathbb{Q}^X}(X(\omega)) &\text{by 6.10, as $g>0$}\\
&\overset{?}{=}\frac{\text{d}\mathbb{P}}{\text{d}\mathbb{Q}}(\omega).
\end{align*}
But I am not sure about the last step; it seems a little shaky.
For every Borel-set $E$, we have that
$$
\mathbb{P}^X(E) = \mathbb{P}(X \in E) = \mathbb{P}\left(X^{-1}(E)\right),
$$
so, when $X$ is invertible, we have that
$$
\mathbb{P}^X = \mathbb{P} \circ X^{-1},
$$
and hence, by associativity of composition, we have 
$$
\mathbb{P}^X \circ X= \left(\mathbb{P} \circ X^{-1}\right) \circ X= \mathbb{P} \circ \left(X^{-1} \circ X\right)=\mathbb{P},
$$
so I believe the 'shaky step' is justified for invertible $X$ (as the same goes for $\mathbb{Q}$), but I do not see why it should hold for every measurable $X$. Can anyone help me with that?
Many thanks in advance!

The important point is to notice that every $A\in\mathcal{F}=\sigma(X)$ can be represented as $A=X^{-1}(B)$ for some Borel set $B\in\mathcal{B}(\mathbb{R}^n)$, by definition of the sigma-field generated by $X$. Then 
\begin{align}
\int_\Omega 1_A(\omega) \frac{f(X(\omega))}{g(X(\omega))}\, dQ(\omega)=\int_\Omega 
1_B(X(\omega)) \frac{f(X(\omega))}{g(X(\omega))}\, dQ(\omega) = \int_\Omega \left (\left (1_B \cdot \frac{f}{g}\right ) \circ X\right )(\omega)  \, dQ(\omega)\\
= \int_{\mathbb{R}^n} \left (1_B \cdot \frac{f}{g}\right )(x) \, dQ^X(x)= \int_{\mathbb{R}^n} 1_B(x) dP^X(x)=P^X(B)=P(A),
\end{align}
where the third equality uses the usual change-of-variables formula and the fourth equality uses the fact that $dP^X/dQ^X=f/g$ on the range of $X$ (as you proved above). The following shows that $dP/dQ(\omega) = f(X(\omega))/g(X(\omega))$ almost surely w.r.t. $Q$, q.e.d.
