The official drinking age in Costa Rica is 18. That said, you’ll be hard pressed to find a bartender who isn’t willing to serve you. Inside San Jose you may find a disco or two that cards at the door. Or you are one those people who looks ten years younger than they really are, you may get carded as well.
Outside of the capital just about anyone can get a drink anywhere. From restaurants to beachside bars, everyone is happy to serve.
It is a good idea to carry around your passport incase a bar should ID you. You should be carrying your passport at all times anyways.