My iphone 3gs won't turn on. If i plug it into charge then it comes up with a small red line on the battery symbol (like the battery is about to run out) and a lightning bolt symbol. If i unplug the charger the thin red line flashes about 3 times then the phone switches off. I have tried charging with both usb and wall socket chargers. I have also tried resetting by holding the home button and the power button. By doing this it resets then goes back to the same battery symbol with the thin red line.
Sounds like your battery is bad. Since its a 3GS, it will still be under warranty. Make an appointment at an Apple store, they have equipment that can tell instantly whether your battery is good or bad. If bad, they will replace your phone.