There's a point in "Bad Teacher" when it begins to transition from a flagrantly rule-bending dark comedy to something still delightfully vulgar but more formulaic. Cameron Diaz' foul-mouthed, pot-smoking, hard-drinking, gold-digging seventh-grade teacher Elizabeth Halsey is having a heart-to-heart with the gym teacher, played aptly by Jason Segel. She asks him how he wound up as a junior high gym teacher, and he gives an answer of some quiet desperation, explaining how most of the world starts in a place, aims for a better place and settles in the middle. Then he flips the question and asks, with a degree of sarcasm, What went wrong in your life that you ended up educating children?
If there's a thread of honest inquiry in a dirtbag comedy that exists mostly to put a hot blonde in situations of casual misanthropy, it's that question, of why school warps everyone who sets foot inside. The caricatures of junior high educators (Phyllis Smith, of "The Office," is terrific as a meek, mentally soft teacher) seem to be drawn directly from caricatures of students we've seen ad nauseum: the granola kid, the overachiever, the naïf. None of the adults seem like full adults — they're all former kids who probably weren't the greatest students in junior high now condemned to a life of instructing the next generation. That sounds like a hell on par with prison, which is what makes Diaz' turn so fun. Finally, it's not just the ex-jock washouts and do-gooders and burnt-out failed authors teaching 11-year-olds. It's also the lusty boozehound who doesn't learn kids' names, cusses like a one-woman union hall and writhes around in soapy daisy dukes for the carwash fund-raiser. Everyone knew a couple of bad kids, back in the day. No one ever thought they'd teach.
There's about as much backstory here as in your average cereal commercial: Miss Halsey finds herself stuck as a teacher when her rich husband-to-be nixes their engagement. The His and Hers Mercedes life she had planned when she quit her teaching job vanishes, and she's condemned to return to school, fixated now on saving up for a breast augmentation that will land her another sugar daddy. She skips meetings, insults students and shows movies every day in class. (All school-related, though: "Stand and Deliver," "Dangerous Minds," a proper nose-thumbing by director Jake Kasdan to preachy school flicks.) This draws the ire of her across-the-hall rival, Miss Squirrel, played as a shrill goody-goody by Lucy Punch. When the twerpy but loaded substitute Scott Delacorte (Justin Timberlake) arrives, a twisted love triangle ensues, leading to one of the most hilariously terrible acoustic guitar ballads ever committed to film, by the very game Timberlake. When Halsey forces her students to cram before a big state exam that could mean a pay bonus, we also get to see Thomas Lennon (of "The State" troupe, once upon a time) as a greasy state ed functionary.
In the last 15 minutes the story sort of twirls around in a circle and falls over, dizzy and disoriented. But the plot exists only as a canvas for as many lewd and foul gags as can be crammed into an hour and a half. The cast, especially Diaz, really sells this world, and it mostly works: Teachers as the dim, craven, selfish, infantilized, manipulative jerks we all imagined they really were when we were stuck in public school. Now that we're older, and actually know grownups who have chosen, bless 'em, to educate children for a living, it's a fair assessment to say many of them will probably find "Bad Teacher" cathartic and, at times, effing hilarious.