Please look here:
iphone Troubleshooting Assistant
http://www.apple.com/support/iphone/troubleshooting/phone/
Reset and Restore iPhone to Original Default Factory Settings with Recovery Mode
iPhone display freezing?
iPhone doesn’t detect by or appear in iTunes? iPhone cannot sync with
iTunes on PC or Mac? Cannot make or receive calls, send or receive text
messages, or access email or the web? Or worse, iPhone simply won’t
turn on and does not respond to tap or button press? If the problem
still persists after you have
reseted the iPhone, or tried
various iPhone troubleshooting,
it may be worthwhile to invoke recovery mode to restore iPhone to
default factory settings, the original state as when you first received
and unwrapped the phone.
Restoration of iPhone to original factory defaults will likely to fix
all problem, with the downside that all data and information stored on
your phone will be lost. Normally iTunes will make a backup
automatically when you connect and sync the iPhone with the program,
however, it’s still a good recommendation to copy out and backup
everything that you may need on the phone before proceed to restore the
iPhone.
To restore iPhone and reset the phone to default factory settings, follow these steps:
- Turn off iPhone - Hold down the Sleep/Wake button
for a few seconds until the red slider appears, then slide the red
slider. Ignore this step if your iPhone is already off.
- Press and hold down the Home button for about 10 seconds until a yellow triangle with a text which says Please Connect to iTunes appears.
- Plug the iPhone into Mac or Windows PC. Release the button if you haven’t.
- Run and open iTunes if it’s not already opened yet.
- iTunes will prompt a message that says iTunes has detected an iPhone in recovery mode. Click OK.
- You will be taken to the iPhone pane. Then, click on Restore.
- Wait for the full restoration process to complete, and the iPhone
will be back to the original settings state as when it left the
manufacturing factory, typically a working phone again if you face any
problem, unless it’s hardware related
http://www.mydigitallife.info/2007/10/04/reset-and-restore-iphone-to-original-default-factory-settings-with-recovery-mode/