California is a bit funky when it comes to the use of a dive flag.
For inland bodies of water, we regularly use one (i.e. Folsom, Stumpy Meadows, Lake Spaulding, Tahoe), but it's not required. I last took the California Boater Safety course in 2001 after the purchase of our 27' O'Day, and the documentation at that time mentioned using a dive flag is recommended and that there was pending law that would require it. It doesn't look like anything since then has been passed though.
I have a friend that was harassed by law enforcement who claimed he was in violation for not displaying a flag, but when it went to court, the judge threw it out because the law stated the use of the dive flag was a recommendation (not a requirement). They tried to argue that the Federal Laws trumped the California laws, but the judge wasn't hearing any of it. This was on the Sacramento River, and it happened while one of the guys from Dolphin Scuba was solo diving for bottles and what not. He had a boat anchored above the location where he was diving, and law enforcement first thought he was up to no good (stealing boats, drug running, who knows what).
Beyond that, the dive flag is a good idea around our neck of the woods, but be careful, not many boaters even know what a dive flag looks like much less know what it means. We regularly use dive flags with SMBs as back ups, and have on occasion had to chase off jet skiers who decided to use our gear as a slalom course. Folsom is really bad when it comes to this, and seems to get worse up near Rattlesnake Bar. It's a good idea to listen for boat traffic before surfacing, or head in closer to shore before popping above 5' depth.
Now Nevada is completely different. I've been ticketed in Nevada for not diving within 100' of our flag. We brought it with us, dropped it off at the outer markers of Sand Harbor, and kicked out to the left of the bay for over an hour. A Game Warden ended up ticketing us after following us most of the dive. A group of local divers met with the Park officials and the Warden on our behalf after we were ticketed, and from my understanding, it's kind of a hit or miss situation now. You may or may not get ticketed based on if the Warden feels like it. In our situation, this Warden had to save a husband / wife team of divers that panicked during a dive the day before we were there. He was out to make a point with us, and said so while he down graded the ticket a bit to save us some cash.
Regardless of whether it's a law or not, IMO it's a good thing to have in California with some of the boaters we have around here, but it doesn't mean you'll be safe or have the right of way (so to say).
My $0.02.
~ Jason