There are two charges with charge q and mass m and they are in equilibrium. Then, in the diagram why is my teacher saying that electrostatic force(F)=mg? Below is diagram.
OK, you've started with a diagram that correctly shows the gravity force and the electric force. It might help to also show any other forces acting on the particle.
What does "equilibrium" mean in terms of the forces?