my friend suggested i get audacity to record my guitar mainly because it was free. i was just wondering is it any good? and also what would i need to plug my guitar into my computer?

It's alright, but I don't think it has a metronome or anything like that, which is a bit of a pain.

If your amp has a 1/4 output, get a 1/4 to 1/8 adaptor to plug into your microphone input on your computer. If you have a multi-effects (like an RP or something) use the USB output on that.
"My job is a decision-making... job. And as a result I make a lot of decisions."
yeah it does have a metronome, audacity is pretty decent for demos and bedroom stuff.

thought if you want to go more professional then you need to start spending money.
If you're like me and just play casually, don't spend any money, and go ahead and get audacity.

However, if you DO have money, I would suggest Acoustica Mixcraft. I've used it for higher quality recordings and it's really good.
"Dude, you gotta pull an "Axl Rose" on them.
Tell them it's your band, if they don't like it, they can get in line and kiss your ass." ~pablo_arg
I suggest higher programs such as a low grade Sonar or Reaper to start with, you can do a heck of a lot more with them after learning the programs.

Not only do you need software, you need hardware too...look into an audio interface
See the UG videos
its actually pretty good, if you buy it you can spend the money you save on a really good mic to record with, which is all you need by the way