Solution.
Substituting the given function, we have $[e^{x^2}g(x)]' =
2xe^{x^2}g'(x)$. Using the correct product rule on the left-hand side
of that equation, we get
\begin{align*}
2xe^{x^2}g(x)+e^{x^2}g'(x) = 2xe^{x^2}g'(x) &\Longrightarrow 2xg(x)+g'(x) = 2x g'(x) \\
&\Longrightarrow 2x g(x) = (2x-1)g'(x) \\
&\Longrightarrow\frac{g'(x)}{g(x)} = \frac{2x}{2x-1} = 1+\frac1{2x-1}\\
&\Longrightarrow \ln |g(x)| = x + \tfrac12\ln (2x-1) + K \\
&\Longrightarrow g(x) = Ae^{x + \tfrac12\ln (2x-1)} = A e^{x}e^{\ln\sqrt{2x-1}} \\
&\Longrightarrow g(x) = Ae^{x}\sqrt{2x-1}
\end{align*}