Even though one might genuinely be interested in the "absolute" question posed, there are arguments in favor of asking the "natural" version of the question, namely, whether there would be a "natural" isomorphism except in the case that $f,g$ are coprime. At the very least, answering the "natural" question first constrains the "absolute" version in various useful (and philosophical) ways, and gives a hint about the "absolute" version.
So, the "natural" question, is whether or not for a PID $R$ the natural homomorphism $R/ab \to R/a\oplus R/b$ by $r\mod ab \to (r\mod a)\oplus (r \mod b)$ is an isomorphism. (When $a,b$ are relatively prime, the Sun-Ze isomorphism (pathetically-often known as the "Chinese Remainder Theorem") gives the inverse. For $d=\gcd(a,b)>1$, there is an element in $R/ab$ annihilated by $d^2$ but not by $d$, while in $R/a\oplus R/b$ there is NO such element.
(One could argue that thinking about the "natural" map was a "red herring", methodologically, since it played no formal role at all, but, I argue, the context and sense of it may be helpful in delimiting the issues... and when it turns out not to be critically relevant... well, ... great!)
Thus, perhaps as though by accident, we discover that a device to prove that the natural (and arguably an isomorphism if destiny says there should be...) map cannot be an isomorphism proves more, namely, that no map can be an isomorphism. A methodology point as well as mathematical-fact-ual.
[Of course, other peoples' intuitions prefer other methodological advice...]