The question is in the title. It's really hard to "show my effort" on this, because it's just coming up with an example. My effort is... thinking about it for a while? I thought about letting $R = \mathbb{Z}$ or $\mathbb{R}[x]$ but I'm having trouble getting an example of $M$ being decomposed in this way with two different $F$'s. Would love a step in the right direction. Let me know if there's other ways to improve this question by showing some kind of motivation or effort.
This comes from Steven Roman's text "Advanced Linear Algebra" as Exercise 6.5. As far as sufficient conditions goes, the fact that it's a PID helps, which is why I mentioned coming up with specific examples of PID's. Just thought I could use the Gaussian integers, too.