Solving the iPhone repeated rebooting problem
First try replacing the battery. If that does not help, please try the solution below.
This appears to be a software problem, not a battery problem. Try putting the phone into Recovery Mode.
Turn your iPhone off by holding down the Sleep/Wake button (on the right side of iPhone 6 and up, in the top corner on all older iPhones). Press until the slider appears at the top and then swipe the slider.
If your phone does not respond, press the Sleep/Wake button and the Home button together until the screen goes dark. (On iPhone 7 and above, press Volume Down instead of Home.) Connect your iPhone to your computer. If you don't have a computer, you'll need to go to the Apple Store or borrow one.
Perform a hard reset on the phone. Do this by holding down the sleep/wake button and the Home button at the same time (again, Volume Down on iPhone 7 and above). Continue holding for at least 10 seconds. If the Apple logo appears on the screen, keep holding.
Let go of the buttons when the Connect to iTunes screen appears (as shown in the image below).
The phone is now in recovery mode. A window pops up in iTunes, offering to let you Update or Restore the phone. Click Update. This will try to resolve the problem without erasing your data.
iPhone in iTunes recovery mode.