Iphone 4s screen blacks out and turns back on?

So recently my iphones battery had been dying faster than usual so since I'm a do it yourself person i unscrewed the back then unscrewed the hatch for the battery replaced it with a new battery. The phone powers on and works but after about 5 minutes the phone will cut off and then reboot. I don't get why its doing someone help me please

You better make a backup in itunes as soon as possible. Then do a facory restore. If that fixes it, then do a restore from back up.

Try putting back the old battery and see, your new one might not be up to specs.