From a pure simulation point of view (Warning: link to my book), aiming at simulating from a product $f\times g$ of two (positive) functions such that $fg$ is integrable over the proper region suggests some specific methods:
- Sampling-importance-resampling: to apply when samples from both $f$ and $g$ can be produced and when the corresponding numerical values of the normalised versions of both $f$ and $g$ at those points can be numerically computed (resampling is not necessary for computing integrals related with $fg$).
- Accept-Reject: to apply when either $f$ or $g$ is proportional to a standard probability density, and the other term in the product is bounded.
- Slice sampling: to apply when either $f$ or $g$ is proportional to a standard probability density, easy to simulate, and the other function is such that the set $\{x; f(x)\ge a\}$ is easy to construct. Or when both $f$ and $g$ are such that $\{x; f(x)\ge a\}$ is easy to construct.
- Metropolis-Hastings algorithm: to apply when either $f$ or $g$ is proportional to a standard probability density, easy to simulate, and the other function can be (numerically) computed.
- Bridge sampling: to apply when both $f$ and $g$ are proportional to a standard probability density, when samples from both $f$ and $g$ can be produced in a reasonable time, and when the corresponding numerical values of both $f$ and $g$ at those points can be (numerically) computed.
- Nested sampling: to apply when either $f$ or $g$ is proportional to a standard probability density, easy to simulate, and the other function can be (numerically) computed.
Those different solutions do not necessarily take into account the fact that $f$ is a prior density and $g$ is a likelihood. Actually, it is not necessarily the best possible decomposition of the product $fg$, because $f$ can be too flat or even improper, while $g$ is not necessarily integrable in the parameter.
Note: A similar question was asked on Cross Validation last year
but did not attract any traffic. I added links to scalable Monte Carlo solutions
on that page.