"iPhone 3?" Doesn't exist. Either you have an iPhone (original), iPhone 3G, iPhone 3GS, iPhone 4, iPhone 4S or iPhone 5. I assume you have an iPhone 3GS, which is compatible all the way to iOS 6. You can do so, if you have iOS 5, OTA, or Over the Air by going to Settings, General, Software Update. If you have iOS 4.3.5 or below, you can use iTunes and click "Update" in the "Summary" section of your device (When plugged into your Mac or PC with iTunes 10 or above).If you have an iPhone 3G, iOS 5 is not allowed, plainly because the hardware doesn't support it. Maximum for iPhone 3G is iOS 4.2.1.
The first step is to update to iTunes 10.5 where you will first open iTunes and then check for updates to install version 10.5. Secondly, connect your iOS device and then click on the download and update button. Next, click through the next 3 screens to begin the download. Read more on http://howto.cnet.com/8301-11310_39-20119358-285/how-to-install-ios-5/.