I started having this same problem at 7:30 this morning. I went as far as reseting the entire phone to factory defaults, but few hours later the problem repeated. The phone thinks it's docked to a computer, and that's the screen we are all getting. It will randomly make the docking notification sound, the home key function will change along with the screen, and when the problem goes away it plays a different notification signifying that it has undocked.
Most of the solutions I have read are software related. I don't see how that could be the case for my phone considering the problem persisted after restarting, taking the battery out and waiting 15 minutes, doing a a soft reset, and finally trying a full factory reset. After doing so the phone was exactly the same as the day I got it, yet the problem was still there.
I did come across a few message boards that say it could be a hardware issue, specifically a broken mini USB connection. Supposedly the mechanism by which the phone recognizes a dock is shorting, or it's mechanical and is broken or bent. Again, this doesn't make sense, as I have never seen this screen before. When connected to a charger, a computer, or just a USB cable that's not plug into anything it remains on my home screen, not the "dock screen". In fact I had never seen that screen until the phone malfunctioned.
The only fix I have found so far was to give the USB socket the Nintendo cartridge treatment; blow into it really hard.