I'm just wondering. I live in the OC by the way. I like to ride against traffic because it makes me nervous otherwise. I grew up in Brooklyn and there they tell us to ride facing traffic.
California law on this is somewhat complicated.
First, though: your intuition and childhood bicycle safety lesson is wrong. It's safer to ride with traffic on the road than on the sidewalk. Cyclists being hit from behind is very rare, but being hit by cars at intersections or driveways is much more common, and the sidewalk puts you at much greater risk of that kind of collision. The advice you had about riding against traffic is bad advice that's only valid for people walking 4 miles per hour along the side of the road.
In California, it's legal to ride on the sidewalk, but individual jurisdictions (counties or cities) can make it illegal. It's not uncommon for a city to make it illegal to bike on the sidewalk in a downtown area, but leave it legal in residential neighborhoods.
In other words, the legality question is local to Orange County, the specific city you're riding in, and possibly even the specific area of the city you're riding in.
This chapter does not prevent local authorities, by ordinance, from regulating the registration of bicycles and the parking and operation of bicycles on pedestrian or bicycle facilities, provided such regulation is not in conflict with the provisions of this code.