Wierd. My Nano today would start playing a song and two minutes into it it would turn itself off. A quick googling allowed me to reboot it by holding down the menu button and the center button together for 5 seconds. The Apple logo should appear as it reboots. All songs are kept intact. My auto-shutdown issue went away after the reboot.
If yours still has the issue you can try restoring it with itunes. But that’s a bitch since itunes blows. Anyways. Hopefully the above tip works for you.