(b) Suppose in the following figure, equilibrium of charge $B$ is considered. Hence for it’s equilibrium $\left| F_{A} \right| = |F_{C}|$
$\Rightarrow \frac{1}{4\pi\varepsilon_{0}}\frac{Q^{2}}{4x^{2}} = \frac{1}{4\pi\varepsilon_{0}}\frac{qQ}{x^{2}} \Rightarrow q = \frac{- Q}{4}$
Short trick : For such type of problem the magnitude of middle charge can be determined if either of the extreme charge is in equilibrium by using the following formula
If charge $A$ is in equilibrium then $q = \ - Q_{B}\left( \frac{x_{1}}{x} \right)^{2}$
If charge $B$ is in equilibrium then $q = \ - Q_{A}\left( \frac{x_{2}}{x} \right)^{2}$
If the whole system is in equilibrium then use either of the above formula