If your PlayStation 3 controller stops working for any reason, you can use the reset button to return it to the factory settings. This means you'll need to sync it with your system again after you've reset it. If resetting the controller doesn't work, you'll need to fill out a service request form on the PlayStation website.
Resetting the Controller
On the back of the PlayStation 3 controller by the left shoulder buttons, you'll find a tiny reset button. It looks just like the one you might see on your Internet router. Using a paper clip or similarly thin object, push the little button down to reset the controller. Once complete, you'll need to reconnect the controller to the console via USB cable and press the "PS" button to initiate setup.