If you want to type and print your composition as sheet music, try:
GNU LilyPond http://lilypond.org/
G Sharp http://common-lisp.net/project/gsharp/
Audacity, as another post mentioned, can edit recordings you make with a microphone.
http://audacity.sourceforge.net/
If you have an electronic piano, you might find Rosegarden very useful. It has some of the features of the other programs, but it is a sequencer for editing the notes you actually play on your piano, over a MIDI cable.
http://www.rosegardenmusic.com/
All of these are free as in beer, and free as in speech.