bridge rectifier connected to a raspberry pi gpio
I'm not entirely happy with the answers given about dividing voltages etc. as they are not (IMHO) a good approach, from both safety and engineering angles.

I would suggest a basic opto-isolator circuit or even a small relay with a 120v coil as safer, simpler and more effective ways to detect the presence of mains voltage without exposing the Pi to high voltages, floating grounds, etc.