I usually bring my passport when I’m driving, just to be safe. But from what I understand, it is usually permissible to only carry a photocopy of the picture page and the page with your visa stamp showing you are in the country legally.
But you will find in Costa Rica that sometimes the laws/regulations haven’t filtered down to the official you are dealing with, whether it be immigration, someone at the bank, or wherever you go. It can be frustrating.
Driving without any sort of passport or copy is definitely a no-no. Sometimes they will take you to immigration until you can get the required documentation. There is also a fine.