I would say you’ve got a hardware issue. Apple can do remote diagnostics. At this point, your other option is reset all settings on your iPhone. This in effect sets all settings back to factory defaults. Please follow this path,
iphone > Settings > General > scroll down > Transfer or Reset iPhone > Reset > Reset All Settings > enter passcode and confirm reset.
You can request Apple Support assistance. You need to have Apple perform diagnostics on your iPhone. It can be done in person at an Apple Retail Store or at an Apple Authorized Service Provider. You can also contact Apple Support and request remote diagnostics.
If you’re in the US please call 1-800-MY-APPLE or outside the US, consult the support articles below.
Contact Apple for support and service - Apple Support
Genius Bar Reservation and Apple Support Options - Apple
Explore Service Locations
Official Apple Support