Let $R$ be a PID. How can one show that for all non zero $a,b \in R$ we have $R/(a) \oplus R/(b) \cong R/\gcd(a,b) \oplus R/\operatorname{lcm}(a,b) $.
I have no idea how to define such an isomorphism. What I tried is to define $f([x],[y])=([\gcd(x,y)], [\operatorname{lcm}(x,y)])$. I didn't get anywhere with that my map is probably not even well defined I got lost in the calculations. So does anyone know how to find the desired isomorphism.
Thanks in advance