My power button also has become unreliable. I have a iPhone 5. I've found when I want to hit the sleep button, sometimes it works, sometimes it doesn't. Sometimes, it just takes a second or so to respond. Is this a software problem or hardware problem?
Most likely a hardware problem which was more common on the iPhone 5. It happened to me and I bought a new button and toolkit from iFixit and replaced it myself. It wasn't too difficult and worked great after that.