When choosing what firearm you're going to carry during the zombie apocalypse, there are several things to consider:
Rate of Fire
Maintenance For obvious reasons, you won't want a gun that will break or jam while taking on hordes of zombies. Replacement parts will be difficult, if not impossible, to find after Z-Day. So you'll need something durable. The AK-47 is an excellent example of a highly durable firearm. it doesn't jam, and is extremely hard to break. God forbid it does break, however, and you're screwed. Whatever you choose, have a small repair kit handy, preferably with replacement parts.
Accuracy Considering you'll be aiming at the zombies head, which is the most difficult part of the body to hit, you'll need an accurate firearm. What you want to look for is something that's accurate between 150-300 yards. Anything less, and you'll have a hard time hitting your target. Longer range is fine, but while on the run, engaging targets from too far away will just attract more zombies.
Rate of Fire Some assault rifles in use by various militaries can fire up to 600 rounds a minute. While fighting insurgents, terrorists, and other militaries, this is a good thing. While combating the legion of the damned, however, automatic weapons just waste ammo. Semi-auto and bolt action guns are more accurate, and better for conserving ammo. One thing to to consider though, is that during the early days of the zombie apocalypse looters and the like will be fairly common, and an automatic weapon could be handy. A weapon with selective fire is recommended.
Ammunition You'll want something that can punch a hole in a zombie skull at 300 yards, but light enough to carry along with the rest of your gear. The 7.62mm has a lot of stopping power, but is too heavy to carry a lot of. The 5.56 is used in U.S. military assault rifles because it is light, yet retains stopping power. The .22, while very common, does not have enough stopping power to be effective at long range. One advantage it does have is that it's quieter than larger calibers. Something else to think about is how much harder it will be to find ammo as time goes on. Some weapons can be converted between calibers in the field. Carrying the extra parts will probably get annoying, but being able to use multiple calibers will be invaluable as time goes on.
Weight The heavier your gun and ammo are, the food and gear you'll be able to carry. Just something to keep in mind.
Personally, I prefer the Ruger 10/22. It's reliable, ammo is cheap and easy to get, and the are plenty of accessories for it. It doesn't have a very long range, but it's better to run than to fight.