The train is 3.6 euros one way, or 6.2 euros RT (about $8.40). I've stayed near the airport and also in Haarlem, and never had a problem going back and forth to Amsterdam Centraal station. You can easily buy tickets from machines in the airport. I did a quick check for right now (after 10pm Sunday night) and the trains are running every 6-12 minutes, so you shouldn't need to worry about frequency.
http://www.ns.nl/servlet/Satellite?c...338201&lang=en