It's not a bad idea to take a gun safety course regardless of whether you intend to buy a gun. I'm in favor of most people understanding how to use a gun safely, whether they ever intend to use one later or not.
But my advice is never buy a gun you haven't shot before. You don't know how it feels, how it shoots, what the trigger reset feels like, and if you're going to buy one, you want to get one that feels good to you so that you shoot it well.
Some other guy earlier recommended a Glock 19. Glocks have a huge following, this is true. I'm terrible with a Glock, my wrist/grip is too weak and I often end up jamming them. (Yes, that's something I need to work on, but it's also why I own something different - I don't want something that I know I have problems with in a life-or-death situation.) Also, I think they're ugly.
I'm more a gun owner because I like target shooting than for protection, but I'll admit I've carried while traveling alone (through states where my CCW is honored). I own a small Ruger revolver, a Sig, and a Beretta, and the Sig trigger is absolute heaven. If I had to go for only one of my weapons and I needed to be damn sure I hit spot on where I'm aiming, the Sig would be the one. However, the revolver is more concealable, and a .38 special is more "punchy" than a 9mm. The Beretta - well, that one's just pretty. It doesn't have any qualities I prefer over the others, except looks.
My mom owns a really similar revolver (looks-wise), a S&W, same caliber, but each of us hates the way the other's gun feels in our hands. Mine has a beefier grip that's a little big longer, which is uncomfortable to her, but feels right to me. Hers feels too slim to get a good grip on (to me). Point is, figure out what you like and why, and you can really only do that by trying out different things.