Most locksmiths can test the fob in a couple of seconds.
If the fob is OK and the problem is intermittent and is a problem unlocking, it is often a wiring problem, if its a problem locking its worth checking that the ignition barrel is not sticking in when you take the key out, this is often...