Input 5v to pin from external power source

Hello. Can I connect to a pin 5v from a power source directly? If yes, should I connect the power source ground to the Arduino's ground? Do I need to use any extra resistor? The purpose of this is to know if the power source is ON or OF. Thank you for any help.

I would use an optocoupler, they are cheap, a whole lot cheaper than a new Arduino.

klubfingers: I would use an optocoupler

Good idea, then if the input spikes over 5V you're safe.

Configure as shown here for example. Your input lights the opto's LED. In Arduino-land you don't need the pullup resistor shown on the right hand side of the schematic, since you can use the internal one. Take care of the inverted logic in code: when your input is high, the LED is on, the transistor closes and the opto's output goes low.