How to make a simple up and down "head bob" for first person game's camera??

Just out of curiosity, how do you check to see if the player is in the air? I have a solution I am currently using and wanted to compare and see if I should adjust anything.