it's not too difficult, but you do need to know what you are doing. I could write a very long post on the proceedure, but others have done it far better than I could. Just do a Google search on "iPhone DFU Mode"
IMPORTANT items to remember.
ALWAYS set up an iCloud account and back up your iphone to the cloud first. (will make sense soon.)
ALSO download any Photo's which you do not have in photostream or in iPhoto / Aperture / etc to whatever application you use to manage photos.
Force your Phone into DFU Mode (see note about Google Search)
Connect your iPhone to your Computer via Sync Cable
iTunes should open up and inform you that it has found an iPhone in Recovery Mode.
It will ask you if you wish to restore the phone.
You want to reply Yes.
iTunes will download and install a clean copy of iOS 5. AS PART OF THIS it will also reload the firmware.
Once this has completed, it may ask if you wish to restore from a backup copy stored in iTunes.
DO NOT DO IT. I don't know 100% of the mechanics, but the Genius Bar Tech stated that doing so (as your main restore) could reintroduce the problem.
Instead, you want to restore from your iCloud backup. (The reason this probably works is that backing up to the cloud dosn't actually send copies of your programs to Apple's servers. It only sends information such as your contacts and other program data, along with a reference to what programs are installed. (since all of the programs are already on the iTunes server, it does not need your copy; it just needs to know you have a copy currently installed.) When you perform a restore from the clound, you are in essece, downloading clean copies of all applications.
Depending upon how much you have installed on your phone, this could take a while. I spent 2 hours in the Apple store waiting on the resore to complete. (Had I known what the tech was going to do, before he did it; I would have volunteered to do it myself at home.)
This will restore your applications, notes, etc.
What it WILL NOT restore is Music that you have not previously stored in the cloud. (Not sure how many Music Match users are out there yet) It will not restore Photo's either (other than providing access to whatever you may have on Photostream. (You did remember to download photo's to your computer first - right?)
Once the iCloud restore is complete; you will need to reconnect to iTunes to reload any music / audiobooks / photo's, etc that you had previously synced. Once again; depending upon how much you have, this could be time consuming.
Once done, this should fix the problem (per Apple Genius .... I have not had the two days of testing that I previously mentioned I plan on using to put the phone through its paces.)
If you have not done so already; it couldn't hurt to try fully cycling the battery once or twice. (Run it down to the point where the phone shuts off due to low battery, then recharging overnight to 100%.) For me, the simplest way to accomplish this was to download one of the free flashlight apps (turns your camera LED on full time) and let it run until the phone shuts down. (I did this before going to bed) Then plug in the phone and let it charge overnight.
As I said; there are many posts on the web on how to do this stuff and many are written quite well. If you have never done this before, don't rely 100% on my guidance. Read some of the blog posts and information available. (Much happens to come from the jailbreaking world). The more you read about the same thing from people with different writing styles, the better chance you will have of fully understanding the process.
Of course, the simplest method for someone who is not familiar with this process would be to make an appointment at your nearest Genius Bar (This is based upon an assumption that you have a nearby Apple Store) and let them perform the Restore / Firmware Flash for you.
(Did I say somehting about others searching the web so that I wouldn't have to type out an excessively long message ????????? )
Hope this helps.