That was asked for here before I think (and seeking spike). Or at the old forum.
I only found a link where Buffy is undercover for another story (Mafia, not high school), will check my links again later. (I can't remember the title at the moment).
The other story I was reminded of is Over The Summer by SlayerFan. It's still at
FF.net. But there wasn't a undercover part, only that Buffy vanished later.
*edit again* Found it:
https://www.spikeluver.com/Forum/index.php?action=vthread&forum=2&topic=190spike is a english teacher and married to Drusilla. he begins a relationship with buffy thinking she's 17 or so. Dru blackmails them and buffy leaves. it turns out she is actually an undercover FBI agent and she is like 28.And it got answered:
it's by sam52. it's been taken down to be worked on. when i asked over on seeking spike she said she will eventually put it back up.The title wasn't mentioned but it sounds like the story you're looking for.