If you are looking for an unlocked iPhone you will have to find a carrier (please note there are none in North America) who sells the iPhone unlocked. You can see who does here:
http://support.apple.com/kb/HT1937
You will have to contact those carriers to see the cost of getting the iPhone and alot of them required more money for an unlocked iPhone or will only do it at the end of the contract.
Also there is no guarantee that it will work with your carrier or any carrier in Costa Rica. Chances are that there is atleast one GSM carrier in Costa Rica which will work with the iPhone, but there are also horror stories of carriers charging an arm and a leg since the iPhone tends to use more data than other phones.
I'd stay stick with whatever phone you have and wait till there is an official carrier in Costa Rica.