How do I make the music player display on the lock screen? When I'm listening to music on my Android using Music Player, I want to see what song I'm listening to on my lock screen, and maybe even play/pause and go forward/backward on the playlist, but not change the playlist.

How can I get this kind of a setting? Do I have to write my own app?
By default, the stock player has the player controls in Android. Play a song from your stock music player app (the one which was originally included in your mobile) and play a song. When you turn off the screen and get back to the lock screen, you must be able to see the player controls. 

You can also try Sony Walkman which offers a number of features including lock screen controls. You can also use an app like Simply Lockscreen to enable music player functionality to your lock screen.