C.R is reasonably safe but often tourists manage to put themselves is stupidly risky spots. If you stay out of some areas of San Jose you will be fine.
Hotels are pretty expensive, at least the ones most people are likely to use with small children. But houses are available and relatively cheap outside of the San Jose area.
Read on line amcostarica.com or theticotimes.net Both are online English papers that cater to English speaking residents and visitors. Both have long listings of housing available (but usually not the cheapest available being aimed at foreigners). They also have sections for people specifically in your situation, giving travelers advice. But think before you act. Probably figure on spending a week or so in a hotel before finding a place for the rest of your stay.
Renting houses for short terms, 2 months or so, is common and far cheaper than hotels. Still, you can rent at any scale, from shabby bungalows in perfect safe places to luxury houses with modern services, maids and thieves, with every combination in between. Your choice, of course.
Costa Rica is overwhelmed by foreigners, your only problem will be too many people giving you advice based on their self interest. THis is a problem everywhere but more so here than in most places. ANd more so with the people you mostly likely will deal with, foreigners working in real estate.
Last note. If you come during summer vacation the schools here are is session. In a smaller town you may be able to get your son into the local public school. Sessions are short , 4 or 5 hours a day, with many days off. Worth considering.