Here are a few plausible problems: PRAM, the keyboard and the logic board. When I had this problem it was the keyboard.
Try resetting PRAM.
http://support.apple.com/kb/PH4405
If that does not work make an appointment to visit a Genius at an Apple Store or an Apple Authorized Service Provider. They will diagnose it for free and give you and estimate for repairs, if needed.
In the mean time, if resetting PRAM does not fix it try using an external keyboard, if you can borrow one. If keys misbehave on the external keyboard then it is most likely the logic board otherwise it may be the keyboard. Replacing the keyboard is less expensive than replacing the logic board.
Check out https://discussions.apple.com/thread/5274701?answerId=22857031022#22857031022
Genius reservation http://www.apple.com/retail/geniusbar/ .
If not near an Apple Store, find an Apple Authorized Service Provider https://locate.apple.com/country
Check your warranty https://selfsolve.apple.com/agreementWarrantyDynamic.do .
Check your service options: https://getsupport.apple.com/ProductSelector.action .
Be sure your your backup is current (Time Machine or other) on an external disk before you take it for repairs. If you don’t have a backup then buy and external disk and create one soon. If it is the logic board failing a backup can save your bacon. You should always have at least one reasonably current backup and it is better to maintain two of them. See https://discussions.apple.com/docs/DOC-3045