If you're still under warranty, bring it to Apple and have them replace it. If you're out of warranty, and you or someone has the tools to do so, remove the rear chassis of the phone, and take out the battery. Leave the phone and battery detached and separated from each other for an hour or two, then re-assemble so you reset the NAND.