Can we upgrade and jailbreak Iphone 3gs V4.0.1 (8A306), Firmware 05.13.04, Model:MC131B, Carrier : 7.0 ?
You can upgrade an iPhone 3GS to iOS 5.0.1 if you have SHSH blobs saved for it - see this detailed guide to checking your SHSH blobs and using them. It's best to upgrade using custom firmware to preserve your unlockable baseband, and that guide includes how to make and use custom firmware. After upgrading your device to iOS 5.0.1, you can easily jailbreak it using redsn0w.
If you don't have SHSH blobs saved for any version, you'll have to upgrade it to iOS 5.1. Again, it's best to use custom firmware for this to preserve your baseband, even though ultrasn0w isn't compatible with iOS 5.1 yet. iOS 5.1 only has a tethered jailbreak available unless you have an old-bootrom iPhone 3GS.
Make sure you have the latest iTunes installed.
Download the stock iOS 4.2.1 firmware (IPSW file) for your device.
Select Simple Mode from the top of the PwnageTool Window.
Select your device and click on the Next Arrow.
Browse for the 4.2.1 IPSW.
Start Tss server on tiny umbrella
Build custom IPSW and restore to it in PWNED DFU Mode (make sure you do not select the stock IPSW)
open cydia and install ultrasn0w
(i think i might miss some steps here since i never used pwnagetool before, i believe its similar to sn0wbreeze hopefully someone can correct me)