So, I'm a biologist at KCL, but I quite like mathematics and so am going through a book of exercises in algebra. Unfortunately, I've run into a problem in trying to answer some of the questions. I've been told that here might be a nice place to ask and so I was wondering if anyone would be able to help me (my mathematician friends also tend to be strict about notation, so apologies if it's not right). The questions lead you to showing if you have a principal ideal domain and a finitely generated module over it, then that module must be the distinct sum of a free module and its torsion. I can get to this point. However, it then asks if this free module is unique and why this may be false if it's not over a principal ideal domain. Here is where I get stuck.
Attempt at solution: I don't fully understand what it means by unique. I tried to generate some modules to see if I could see what was happening, but I think I'm falling down at understanding how to use the torsion. I tried things like the integers, but ended up with no torsion for any module I could think of. I the tried things like Z modulo nZ, but couldn't think of modules over them. Naturally, I looked online and I think this is known as the Structure Theorem For PIDs, hence the title, but couldn't find any concrete examples. I've also read that the ideal (x,2) over the integer polynomial ring provides a counter example, i.e. the second part, but I can't see how.