Do the following in this order and check after each step to see if it is working again.  

1. Check to make sure mouse is plugged all the way into the USB port. 

2. Try a different mouse.  

3. If you have the mouse plugged into a keyboard, try a different keyboard. 

4. Restart your computer  

5. If that doesn't work, try resetting the pram on the computer by restarting the computer and holding down the shift-option-p-r keys all at the same time until a chime sounds. Release the keys. 

Resetting the PRAM youtube video.