In it's purest sense, you can write a song with nothing but your own brain. If you can hear the music in your head and craft the lyrics, you're away laughing.
The tricky bit is getting those ideas into a form that other people can appreciate.
So I've built up a basic recording system at home, refined over the years, so I can get my ideas down as quickly and easily as possible, and with enough quality that I can do commercial work, including mastering jobs.
The core of it is my Apple MacBook Pro.
There's a bunch of good reasons for having a laptop, not the least of which it's almost always with you so if you suddenly have a great idea you can act on it, or if you're stuck in the airport or on a plane, you can be editing or mixing. I upped my RAM to 4GB so everything would run smoothly - you want at least 3GB nowadays for audio really. It wasn't long ago that the humble laptop wasn't powerful enough for recording and mixing, but with the new generation of Intel multi-core Macs, they compare well to tower systems.
I originally chose Apple because I prefer to use Logic Pro as my writing and recording application (since I've been using the product since it was Emagic Creator on Atari), and you HAVE to run it on a Mac. With an Intel Mac you can run Windows as well, so I have the best of both worlds.
Logic has a Caps-Lock keyboard which is really handy for playing in notes from the computer keyboard when you're out and about, and is really aimed at song writing and production, so it has heaps of software instruments and loops built-in.
Since you don't really want to be using the built-in sound on your computer for recording, and you may need multiple inputs or phantom power for condenser microphones, in my studio I have a Presonus Firestudio which I have everything plugged into, ready to record at a moment's notice. The Fireport also has a MIDI in/out port built in, which is handy.
For recording, I have one decent microphone which I use for pretty much everything - it's an Avantone CV-12 valve large-diaphragm condenser. It's a beauty. It cost me about $700. It's 9-position multi-pattern and comes with a spare valve (for tweaking the sound of the microphone) and a suspension cradle. For the price, it sounds awesome.
Although it's not an essential, I have a Drawmer 1960 dual valve preamp/compressor which I have the Mic permanently plugged into. It's a fantastic preamp for vocals and mastering.
For listening, I have a few different sets of headphones and a pair of Mackie HR824 monitors. I used to have some small Genelecs and a sub, but getting the position accurate for a sub is a real nightmare, so I changed to the Mackies which have really good low-end response without using a sub. I do a fair bit of mastering through these and they're relatively flat.
I also have an old Yamaha CS1x synthesiser, which I mainly use for sending MIDI to Logic Pro so I can record and play the built-in software instruments. It's got some great sounds of it's own though, which I probably don't use enough.
With this setup, I can get sounds down really fast while I'm inspired or just suddenly have a great idea. The most I usually have to do is quickly plug the laptop into the Presonus via a handy firewire cable, and it's all go.