Detecting if 120v AC wire is live with a 2 or 3 VDC line
@Finbar's suggestion is the easiest and safest if you just want to plug it in and don't care about response time. Use a genuine safety-agency approved charger, not some dollar store item made of Shenzhen street sweepings, some of them are very bad (and unsafe) indeed. 

You should add a bleeder resistor to drain the output votlage in a reasonable length of time and you'll also need to reduce the 5V USB output to 3.3V or so for the Raspberry Pi. A single pair of resistors can accomplish both requirements, say 1.8K and 3.3K. 







simulate this circuit &ndash; Schematic created using CircuitLab

Test it to make sure it responds fast enough, some chargers can take close to 1 second to start up and there will also be a noticeable turn off time. Because the turn-off is "soft" you should apply software debouncing if you're looking for edges. 



Alternatively, you could use a standard "AC input" module made for industrial use. They are multiple-sourced and made to be safe and reliable.