Official currency Edit
The official currency in Costa Rica is the colon (CRC). Like anywhere else, there's bills and there's coins. Coins have denominations up to 500 colones, bills go from 1.000 to 50.000 colones.
Many places will let you pay in US Dollars and (sometimes) Euro.
There's no regulation that says what currency you have to pay in. If the seller is willing to accept your currency, be it US Dollars, Euro, Colones or anything else, it's done. But, there is regulation stating that all commerce and services must convert prices to the official currency, at the official exchange rate, and take payment in local currency if requested by the consumer.
In other words, if you find a price at a restaurant stated in US Dollars, and want to pay in colones, the restaurant is under legal obligation to convert the price to colones, at that day's BCCR "venta" exchange rate, and take your payment in colones. They cannot refuse to accept colones or use their own exchange rate. There can be no "surprise" costs at the register, in other words, the converted price they give you must be the final price, with all taxes and costs applied. They must also be able to prove to you that they are using the official exchange rate, allowing you access to a credible source. If the restaurant says they don't know what you're talking about, you should tell them to see Regulation #7472, decree #37899-MEIC.
Of course the above does not apply only to restaurants, but to any establishment operating within the country that sells you something, product or service.
The opposite does not apply, so be careful. If you find a price in colones, and wish to pay in US Dollars, the seller is not required to make the sale, or to use the official exchange rate. The seller can set their own exchange rate, depending on what they consider necessary, or can refuse the sale altogether.
You should beware of any provider willing to deal in currency that's not USD, CRC or Euro. Most banks only exchange those three, so someone accepting other currencies is basically getting nothing. Usually if they accept strange currencies they're giving you an exchange rate that's way off in their favor, or you're about to get swindled. There's some legit reasons to accept other regional currencies (for example people who frequently travel to Nicaragua or other regional countries will sometimes take those currencies), but that's bound to be a very, very small percentage of the people you're going to be dealing with. So play it safe.
Money exchange Edit
Money exchange is done in banks. Period.
The name of the game here, and where most tourists take losses, is called exchange rate. Exchange rate varies from place to place, and banks are always the places where you get the highest amount of colones for each dollar. The rest simply take down the rate to make up for the cost of having to exchange that money later, and that means you end up paying for their administrative cost, instead of having that money in your pocket to spend.
For those not familiar with money exchange, it works like this: you have a foreign currency, say, US Dollars. Imagine that dollar bill you have in your hand is a product, and you're going to sell it to someone. They're buying your money (strange concept, I know), and paying you in local currency (colones). How much they pay you for that dollar is called an "exchange rate". And the transaction is usually referred to as "buying" or "selling" dollars, since you're basically selling someone those dollar bills as if they were a product.
The "reference" rate is posted daily at the Central Bank's website. On this chart, you're the seller, and the chart is from a seller's perspective. "Compra" is the rate at which someone will buy your foreign currency, and "Venta" is the rate at which someone will sell you foreign currency. For example, if you have "Compra: 500 / Venta: 515" that means if you give them $1 (you sell, they buy) they'll give you 500 colones. If you want $1 (they sell, you buy) you'll have to give them 515 colones.
See where the trick is? The exchange rates are always different, "compra" is always lower than "venta". If I give a bank $1, they give me 500 colones. If I want $1 after that, and give them 500 colones, they only give me $0.97, because the "venta" exchange rate is 515. In my example, I take a $0.03 loss per dollar, per exchange. If I exchange $1000, at that very moment, I lose $30 I'm not going to get back, just for exchanging the money. So the first rule is, keep your exchanges to a minimum. Don't just exchange all the money you have at the beginning, because whatever you don't use up, you're going to take a loss on when you go back home.
The second, and most important rule, is look for the best exchange rate. You want the most colones for your dollar, every time. This is where the real losses occur. And I'll solve this one for your right now: banks have the highest exchange rates, so exchange at a bank. Don't exchange at hotels, don't exchange at the airport, go to a bank. If you exchange outside of a bank, your rate is probably going to be 10-20 colones below the bank's rates. That's a lot, and it adds up.
There's small differences in rates between banks, but the major banks you find on the street hang around the same rates. You can find the current exchange rate at different local banks on this page. Don't worry about differences of 2 or 3 colones, unless you're exchanging large amounts (over $3000).
The exchange rate posted at the Central Bank is not mandatory. A bank can go lower or higher if they want to, as can anyone else exchanging currency. If you check the rates page (link above), you'll see most banks are 2-3 colones off the reference rate. That's the normal spread. Outside of banks (restaurants, hotels, etc), they're normally off by about 10 colones. Anything above 10 colones deviation, not worth exchanging there.
Bad ideas regarding money exchange Edit
Most places will let you pay for stuff in US Dollars with up to $50 bills, and give you change in CRC, that's not a good way to exchange money. The exchange rate you get is usually lower than a bank rate, and over many transactions, those amounts add up.
The airports offer money exchange, but beware. You'll be getting a rate that's very low, much lower than you'd get in a bank. In fact, airport exchanges have been the center of controversy many times for their low rates. Avoid airport exchanges at all costs. At the most, do a $20-$50 exchange at the airport, and the rest at a bank.
Exchanging money on the street, with street corner vendors, is obviously a very bad idea. Street currency vendors are pretty rare now, but they do pop up from time to time. Avoid them. Don't even think about it.
Credit cards and ATMs Edit
Another way to exchange money is to use credit cards and ATMs. This might work, or it might not. Depends on your bank's conditions.
Check with your local bank or credit card company to see what their policy is on foreign currency purchases. If their exchange rate is decent compared to the BCCR and there's no comission or penalty for buying in foreign currency, a credit card is not a bad idea. It's certainly safer than carrying around a wad of cash.
Using ATMs to get cash is probably not a good bet. Most ATMs will charge you a fee for using their network. Plus you might have an additional fee from your bank or credit card company. And on top of it all, there's the possibility that the ATM won't be able to contact your home network, and in your attempts to get it to work, you'll mess up and lose your card.