More than likely you have fungus gnats, they are super common in all house plants. They are mostly just annoying but can cause issues if their population gets too big. I've heard of ways to check like putting a cut potato cube on your grow media, and the larva will come to the surface and eat it, and you can see them on their and stuff, but I've never done it. Takes some patience to be done with them, but I used a combination of yellow sticky traps, and mosquito dunks in my res. They are like 10 bucks at home depot you google to find it. This is probably the cheapest way. In my res I put the dunks in panty hose with the end tied, because they don't fully dissolve and are kinda messy, especially if you use pumps. I would spot spray em here and there, but I was done with them in about 3 weeks and they just never came back. The stickies will kill the flying moms, and the dunks in the water kill the babies in your grow media that like to eat roots.
If I happen to be wrong and it is just fruit flies, I don't know that they are a problem, and not sure where they plant their eggs. Gnats like moisture, so other tricks people use are to let their dirt get extra dry, or a layer of sand on top of their dirt so the gnats can't lay eggs or something, i dunno. When I had gnats they liked to hang out by the drain holes of my plants in soil.
Anyway good luck, hopefully that helps!.