If I was to cover a song with my band and post it on my band's myspace, would I need to do some legal stuff?
it's perfectly legal as long as you're not making money off of it.
hug your local pug dealer!
Okay, but what if I was to put it on a record and sell it to people? What would I have to do?
Does the amount of paying differ from artist to artist?

Also, would playing a cover live in front of an audience be okay?
If you're considering any kind of serious cover-playing, consult an attorney. I'll tell you what I believe to be accurate, but I'm not a lawyer and could be completely wrong.

With that in mind...

The artist and record companies will determine how much you owe them. There is probably some amount they can't exceed, but if you're going to try to profit from their song, they ARE going to profit from their song.

If you don't get paid, it's probably fine. However, if the venue advertises that you will be playing in an attempt to get more patrons (and more drink sales), then the venue could be in trouble. In reality, I doubt that anything will happen if it's small-time work, just like the government doesn't care if a babysitter gets paid $40 under the table. However, they will care about large sums of money.

Also, if you're not America, what I said could be completely wrong. (and even if you are American).