You can use the following guide to get to the battery.[br]
[guide|577][br]
On your way there, you'll encounter the main board, which has most of the electronics. check for broken connectors, corroded or dirty zones. When you get to the battery, be sure to measure its golden contact points, if the voltage is a lot lower than 3.7V, (0-3.2V) a replacement might be in order. If you have a lab supply, you could also (carefully) try to bring the voltage back. [br]
If you really want to take a deep dive on this, you could search the circuit diagrams online and use a multimeter to find the source of the problem. [br]
[br]
[[iPhone 3G Troubleshooting]]