Has to be a rifle. There's a saying about a pistol's purpose being to get you to a rifle. Shotguns are good in pinch but a few factors keep them from being an all-around gun: effective range, ammo capacity and size, reloading time.
I'd have to say M1A. Funny enough it's the only rifle I own so far. I'd feel confident enough facing any animal in North America with it. But for a post-apoc type situation I'd give an advantage to M4/AR15 for the ease of capability to scavenge 5.56/.223. I imagine you could find that almost anywhere. Retail stores, police stations, military, abandoned homes-if the owners didn't take off with it already.