iPhone 3Gs turns on and off itself when being charged
after you updated did you restore from a backup or did you set it up as a new iPhone?  To be honest it sounds like your iPhone may have water/physical damage.