The singer recently signed on to star as a substitute teacher in the comedy, which features Diaz, Jason Segel and Lucy Punch.
Speaking to Access Hollywood's Billy Bush at last night's Oscars, Diaz said: "We're thrilled to have him. He's the best person for the job. He's going to be hilarious.
"He's clearly a very talented comedian, look at his Saturday Night Live [skits]. He's fantastic, he's going to be so great."
Diaz and Timberlake split in 2007 after dating for more than three years.
Bad Teacher began filming last week.