One thing really amazed me 26 years ago is that I was able to drink the tap water anywhere in Costa Rica even at the beach!!After living in Mexico, Dominican Republic and Venezuela it was nice to finally drink potable water and It kind of help my decision to stay in Costa Rica because it was telling me that this country was respectful with the environment!
I have traveled all over the country and I have never felt the need to buy bottled water. I have not met a single person who has ever had a problem with the drinking water.
But like anywhere in the world, there are exceptions to the rule: In the last seven years or so there have been examples of contaminated water from farm animals and even reports of Arsenic in some of the drinking water around the country. These are very rare situations, but it has existed. So my advice, is to ask the locals, they will tell you. When traveling in very remote rural areas, or the poorer parts of the city, you should be cautious.
Here in the Papagayo at the beach it is not an issue however a good rule of thumb should be: if you have any concerns at all, buy bottled water. It is very unexpensive.