iPhone 3G shuts down when not plugged in
I have had this problem for awhile and now just getting to troubleshoot the issue. Basically the phone appears to take a charge after it's been plugged in to my computer and/or outlet, however when removed it shuts down after 30 seconds or so and I have to reboot. Is this a battery issue or another underlying issue? Can it be fixed? I took the phone to the apple store but they were not any help due to no warranty. Thank you!
iPhone 3g, iOS 4