My iPhone was having many different problems, the main one of which was my GPS not functioning as it should. After doing some research I found that when you restore from an older model iPhone to a new one, it carries over some residual data that can cause issues.  I had moved from a 3G to a 3Gs to 4 and each time just restored my old settings. I decided to rebuild my iPhone, I backed it up and made sure all my purchases had been transferred. I then wiped my iPhone 4 and set it up as a new phone. I did not restore from backup. I proceeded to reinstall all my apps, data and email account info. I have yet to have a problem with my GPS and my phone actually hangs up at the end of a call, without me having to push the end call button 10x. [more]
 
During this process I also found that having multiple backups of iPhones can chew up a lot of drive space. Just by removing old backups I cleared over 12GB.
Just make sure you don’t delete one you may need.
 
In Mac OS X your iPhone files are backed up at the following location:

~/Library/Application Support/MobileSync/Backup/

Windows XP stores all of your iPhone backup files in this location:

C:\Documents and Settings\user\Application Data\Apple Computer\MobileSync\Backup

Windows Vista and Windows 7 backs up the iPhone files to here:

C:\Users\user\AppData\Roaming\Apple Computer\MobileSync\Backup

Obviously if your main drive is not C: then you’ll have to change that, same goes for ‘user’

Note to Windows users: the Application Data and AppData directories and their contents (iPhone backups included) are considered ‘hidden’ so you will need to enable ‘Show hidden files’ within Windows Explorer before you will be able to see the files.