Operational amplifier (UA741CP) not working in buffer configuration
The 741 is not specified to work with a single 5V rail.  

Minimum recommended supply voltage is +/-10V. With +/-15V supplies, the input voltage range is only guaranteed to be within 3V of the rails, i.e. +/-12V. Similar issue with output voltage swing.

You have to make sure you read the datasheet, supply the part with adequate voltage rails and obey the common mode input range.  The 741 is a very old part and a poor choice for any new design.