Do a search for "tethered jailbreak"!
If this is a new 3G[s], then it can still be jailbroken or unlocked, but you just can't ever let the battery die, or reboot the iPhone when the iPhone is not near a computer.
The phone is new. Apple updated the hardware on newer models. Ultimately, when you get the "Connect to iTunes" message, DO NOT RESTORE.
Connect the iPhone to the computer, spend 30 seconds, run Blackra1n RC3/4, RE-jailbreak, and that's it.
It takes less than a minute.
ALSO, being that this is a new iPhone 3G[s], that requires a tethered jailbreak, I also suggest getting a battery case.
A good one is "Case-Mate Fuel" (google it) but it's ugly as sin. It will however, act as a case AND a charger. Or you could go to BestBuy an pick up a "InCase PowerSlider" case.
That, and a car charger. That way the iPhone never goes off. If you have a laptop, that's ideal/superb.
Let me know how that goes.