Can i update my iphone 3g ios 3.1.3 with latest ios 4?

Ios update from 3.1.3 to 4.0

IOS 4 isn't the latest version of software.iOS 6 is. You can upgrade your iPhone 3g to 4.3.3 which i believe was the last OS that Apple supports for the iphone 3g. You can simply do this by sinking/ hooking up your iPhone to your computer and launching iTunes. Click on your device on the left hand sid of the iTunes screen. You should be able to check for an update on this screen

Hope this helps!

How To Update iOS4 on iPhone 3GS, iPhone 3G and iPod Touch

iOS4 will be released to the general public on June 21, this is different from the iOS4 GM release which was released for developers.

To upgrade to iOS4 on your iPhone 3GS, iPhone 3G and iPod Touch, you will first of all have to upgrade iTunes 9.2, you can download or upgrade iTunes 9.2 using the Apple Update manager.

iOS4 Upgrade iTunes

Once you have updated your iTunes, connect your device, accept the terms and visit the summary page for the device.

On that page, you will see a button to "Check for Update", click on it to see if the new iOS4 update is available for your device. If there's one you can then follow the normal upgrade process and your iPhone 3GS, 3G or iPod Touch will be updated to use iOS4. Enjoy.
Tags: Apple, How To, iOS4, iPhone, iTunes, Tips And Tricks

IOS 4 is now too old and iPhone 3g is upgradable to iOS 4.2.1only now so you can update it to iOS 4.2.1. But iOS 6 is in the market but unfortunatly iPhone 3g doesn't supports iOS 6…

go to the link below and download the firmware you want to install and after that simply open up itunes and you will see a option RESTORE under your iphone's image… Shift+restore and the browse the iOS firmware you download and you are done