Question: I would like to be able to play a piano or keyboard and have what I play stored and reproduced as musical notation. Is that possible?

Answer: 
As others have mentioned a MIDI keyboard and notation application that understands MIDI is what you need.

But, two other important things to mention...

* You probably want to check whether/or how the notation application handles rhythm and *quantizing*, which is a kind of rhythmic precision in the capture of your playing. Even if a person plays with very, very good timing an unquantized rhythm will look crazy with dotted rhythms, ties, 64th notes, etc. Quantizing can do something like move rhythms to the closest sixteenth note, depending on the settings used.
* You will likely need to do some manual editing of the captured notation to do things like correct a rhythm, change an accidental, etc. Depending on what you're playing and the software you will probably need to deal with key signatures, meters, staves, etc. If you don't know how to notate music, you won't know how to proof read and correct the capture.

Software can help speed up the process of notation, but it can't substitute for not knowing how to notate music.
If you expect the process to be fully automatic and the music you play is anything above the simplest - then NO it's not possible. You can get an exact reproduction of what you play, but you will not get even semi-professional results with the score notation.