Like YellowMegaMan stated, if you still have warranty on the controller, I would suggest sending it for repair. If not read on.
I've had a few faults in my SIXAXIS/DualShock controllers and on other console controllers as well. There could various reasons for a faulty button, among them:
- The innards are dirty (dust or other sticky substance)
- Something moved out of place.
- Button is physically broken (plastic fell off)
- Conductive film/rubber base torn/worn
- In the case for trigger buttons, the spring might've come loose or broken
- Solder points/contacts need resoldering.
I'm not the electronic type of guy, so I avoid doing solder jobs, however the other issues aren't too hard to fix yourself.
First thing first would be to open your controller, using one of the many disassembley guides available, I recommend iFixit's but other will prefer video guides. Try and look around your controller innards and compare them with what the guides show. If you have one of the top 5 issues, you'd notice it quickly.
Once you determine what the issue is, fixing it is the next step. Cleaning the controller and making sure everything is in place is straightforward and requires nothing but a screwdriver and a brush, but if you need replacement parts, I recommend searching eBay or DealExtreme for "ps3 dualshock parts" or "replacement" or "repair". Keep in mind that these parts may not be cheap and, depending whether your correctly identified your issue or not, may or may not fix your problem, so take into consideration whether buying a new controller may not be a better investment. If you do eventually get a brand new controller, keep the old one around. You'll never know when you'll need a trigger spring...