The short answer is yes, your mobile phone should work in the main, populated parts of Costa Rica despite it being a fairly remote location, however, there are a few things you need to do in order to stay connected to the outside world when you're on your travels. In order to have access to the internet or be able to send and receive text messages you need to do one of three things: activate your mobile phone's data roaming plan (an option that allows you to use your normal plan for an extra set fee per day on top of your existing plan price), connect to free, local wifi, or buy a local SIM card and join the local network.
Once you've settled on the option that works best for you, you should be able to use your phone in most urban areas of Costa Rica but there are still plenty of places throughout the country that experience no coverage whatsoever so be mindful of that when you're planning your itinerary. These places include isolated and secluded beaches, off-the-grid accommodation, mountain ranges, and forested areas.
If you're visiting more than one country in Central America on your trip, like Mexico or Guatemala, you will need to purchase a local SIM card in each country.
Buying a SIM card in Costa Rica
Thankfully, buying a SIM card in Costa Rica is an extremely easy process as it can be purchased at the airport upon your arrival, or at one of the many stores, kiosks, or street vendors scattered throughout the country. Costa Rica has four main mobile phone providers - Kolbi, Movistar, Claro, and TuYo - all of which operate on the GSM network and should be compatible with your unlocked mobile phone.
If your mobile phone is a part of the CDMA network (such as Verizon and Sprint mobile phone providers in the US) and can't be switched to GSM mode once you arrive in Costa Rica, then it's easier to pick up a cheap phone for USD$25 on one of the local networks and purchase a prepaid SIM card for internet usage and communication purposes.