The pair, who dated for almost four years until December 2006, star together in the comedy movie in which the actress's character Elizabeth Halsey romantically pursues Timberlake's alter-ego Scott Delacorte.
Asked if it was awkward because of their relationship history, Timberlake replied to Access Hollywood: "I didn't look at it like that. We obviously know each other, but I looked at it as a really funny, funny scene that I've never seen done before.
"What I actually remember was, you know, they got to my close-up for that scene, so I was just kind of by myself - which is hard to imitate in real life.
"Jake [Kasdan], the director, kept yelling out, 'OK, more contorted! Uglier face! Flare your nostrils! Curl your lip up more!' And I'm trying not to laugh. I saw it played back one time and I'm really emotionally damaged."
The 30-year-old has been concentrating on his acting career and hasn't released a new album since 2006's Future Sex/Love Sounds but insisted that he will return to music at some point in his life.
He explained: "I have this thing about not putting two things on my plate at the same time.
"I never stopped doing music - I just started doing other things that were inspiring to me ever since I was a kid. And to have this opportunity, I'd be silly to pass it up.
"I'm going to go out on a limb and say I'm not never going to put music out. But I have to figure out for myself what it's going to sound like, and what it's going to feel like, and what it means to me at this point in my life because it really is... more of a personal exploration for me."
Watch the Bad Teacher trailer below (warning: explicit content):