I am having the same problem. Even when I reset the phone as a new phone, it still did it when the battery would get below 50%. I did notice that if plug it in then I hold down the power and home button until it goes blank then release them when the apple screen pops up again, the phone will charge and start working again until the power falls below 50% again. The battery in mine was replaced with a new one 4 months ago. It is annoying and very inconvenient and would like to know how to permanently fix it and whats causing it.