Solution (source code)

= Solution

The positive <density process> is the <stochastic exponential>
$$
Z_t=\exp\!\left(\int_0^t a'(S_s)dW_s-\frac12\int_0^t a'(S_s)^2ds\right).
$$
Since $a'$ is bounded, the <Novikov condition> holds; $Z$ is a true <martingale> with $\mathbb EZ_T=1$ and $Z_T>0$. Thus it defines the stated <equivalent probability measure>. The positive sign in the exponent means that the <Girsanov theorem> gives
$$
\widehat W_t=W_t-\int_0^t a'(S_s)ds,
\qquad dS_t=a(S_t)d\widehat W_t+a(S_t)a'(S_t)dt.
$$
Under this <change of measure>, applying the <Itô formula> to $\pi_t=U(t,S_t)$ produces precisely the <drift> in its backward equation, which vanishes:
$$
d\pi_t=a(S_t)U_S(t,S_t)d\widehat W_t.
$$
Bounded $a$ and $U_S$ make $\pi$ a true <martingale> under $\widehat{\mathbb P}$. Its terminal value is $g'(S_T)$. \b[Consequently]
$$
\boxed{\pi_t=\mathbb E^{\widehat{\mathbb P}}[g'(S_T)\mid\mathcal F_t].}
$$
The sign can also be checked before changing measure: under the original measure $d\pi=-aa'U_Sdt+aU_SdW$, while the <quadratic covariation> term in $d(Z\pi)$ is $Zaa'U_Sdt$, exactly cancelling its <drift>.