If you have just bought the car I would get back to the dealer and seek his help in curing the problem or replacing the key fob.
Good Luck and Best Wishes, Regards, John
So recently bought a car and the sale went quite swift but had no reason to use the key fob till I was home turns out it won't lock and unlock nor will the buttons inside the car the only button that works is the one for lights any help out appreciated