Wi-fi is available everywhere but the most remote rainforest lodge. It's free in nearly all hotels and posadas, as well as in many restaurants and cafes. Free wi-fi is often provided by the government in public squares, though in our experience it's often not working. Because of rotating power outages, connectivity can be spotty at times.
Many posadas also have computer terminals you can use, and most towns still have a trusty old internet cafe, although they're harder to find these days.