How to update my iPhone 3 with newer iOS?

IOS 4.3.5 to version iOS 5

There's no iPhone 3. The iPhone 3G can't be updated beyond iOS 4.2.1. The iPhone 3GS can be updated to iOS 6 by connecting it to the iTunes software on a computer. Once it is updated future updates can be done directly to the phone and will not require connecting to a computer.

http://support.apple.com/...cale=en_US

The hardware may not be up to date enough to upgrade it any further. I would just get an iphone 4 free on contract, as that way you upgrade to a much better phone for free.