My button stopped working only a few months after I starting using it. I did attempt to get it fixed recently and before the store I went to asked what model I had, said outright that if it’s an iPhone 5, it cannot be fixed.
Before trying to get it fixed, I’ve been using Assistive Touch for months. If anyone else is having issues with a faulty power/lock button, just turn on Assistive Touch.
To do this, go to Settings > General > Accessibility > Assistive Touch and switch ON:
You will now see the soft touch button on your screen:
When you tap the button, you will be given options like Siri, Device, Home and Favourites (left, pic below). Tap the Device option to get more options like Mute/Unmute, Volume Up & Down, Lock Screen, Rotate Screen, and More (middle, pic below). Lastly, the More option lets you access Gestures, Shake, Multitasking and the all important Screenshot (right, pic below).
If you want to switch your phone off, it’s slightly tricky as you need to have your cable/power source with you. You go to Device -> Lock Screen but you press and hold Lock Screen for a few seconds until you see ‘slide to power off’:
After switching off, since the power button doesn’t work, you just plug it into a power source and it will automatically switch on.