Try starting it up in "Safe Mode" and see if it will stay working. If it does, then you have something on the device that is the problem. Bad app, malware, virus, etc. If, however, it continues to shut down right away then I would be looking at hardware. Starting with the battery.
If that is the case, try plugging it in and see if it stays on when connected to a power source. If it does, then I would look into replacing the battery. If it doesn't, then you are going to need it looked at. If under warranty, then contact the manufacturer and if it isn't, try a local tech.
To get into "Safe Mode" please do the following.
1. First turn off the phone.
2. Next press and hold "Power" until you see the manufacturers logo on the screen, then...