Let the two charges +Q be placed at points A and B at a distance 'r' apart as shown in the fig. below.
Let us suppose that the third charge 'q' is placed on the line joining the first and second charge such that AO = x and OB = r - x.
Net force on each of the three charges must be 0 for the system of charges to be in equilibrium.
If we assume that that 'q' is positive in nature then it will experience forces due to the other two charges in opposite direction and the net force on 'q' becomes 0. But, the force acting on Q at A or Q at B will not be 0. The forces will act in the same direction.
However, if charge 'q' is taken as negative then, on a charge Q forces due to other charges will act in opposite directions. Hence, the third charge must be negative in nature.
For charge -q to be in equilibrium, the force acting on '-q' due to +Q at A and +Q at B should be equal and opposite.
Now, using Coulomb's law,
\(\frac 1{4\pi \varepsilon_0} \frac {Qq}{x^2} = \frac 1{4\pi \varepsilon_0} \frac {qQ}{(r - x)^2}\)
⇒ \(x^2 = (r - x)^2\)
⇒ \(x = \pm (r - x)\)
⇒ \(x = \frac r2\)
i.e., the position of the third charge is at x = r/2.
Now, to find the magnitude of the charge we will consider the case where charge +Q at A or at B are in equilibrium.
i.e., \( \frac 1{4\pi \varepsilon_0} \frac{Qq}{(r /2)^2} = \frac 1{4\pi \varepsilon_0} \frac{Qq}{r^2}\)
⇒ \(q = \frac Q 4\)