It's a science fiction and maybe horror book for kids written in either the 80s or 90s. I'm fairly certain it's part of a series with different authours for each book. I’m also fairly certain that the cover art had an insectoid alien on it.
The plot is roughly as follows. The protagonist is a schoolboy who happens to be really good at math. He plays a computer game (I am 98% certain it is a MUD and says as much in the book) where he plays an insect and kills other players who are also insects. I want to say the name of the game is Swarm. He is contacted by an alien who helped make the game and learns a math trick from the alien to move forward in time but is warned to never try to go back.
As it turns out, the game is actually a method to turn the children of Earth into the insectoid species while the TVs are generating another signal that turns the parents lazy and uncaring as trash piles up. After his friends start turning into the aliens, the protagonist hides and tries to figure out the math trick necessary to go back in time, messing up once and being saved by the alien who admonishes him. He tries again and succeeds this time.