Yes, the tap water in Costa Rica, that comes from the wells and/or treatment plants of the "Instituto Costarricense de Acueductos y Alcantarillados" (A y A) or in english, the Costa Rican Institute of Aqueducts and Sewers, is perfectly safe to drink. Most of the drinking water in Costa Rica is the responsibility of the "A y A."
The "A y A" uses water from two different type sources to supply cities, sub-surface water and surface water. Sub-surface water is mostly drawn from deep wells. These sub-surface waters are very pure from the point of disease transmission but an application of chlorine is made as a preventive measure against possible contamination in the distribution system.
When river water is utilized, the water is first passed through water treatment plants. In the plants is passed through a series of filters, then, when crystal clear, it is chlorinated. Naturally, if given water from a private water supply, perhaps on a farm, you should be careful!!!