If the particles aren't collinear then there will be an unbalanced force. The particles will lie on a triangle and thus all particles will feel an unbalanced force.
Now we have established that particles are collinear.
If they have same magnitude then either the one on terminal or the one in center will feel an unbalanced force.
If they have the same charge then obviously the particles on the terminal will get repelled. Thus they have different signs.
The equilibrium is unstable as if one charge is given a displacement then the charge configuration will never remain the same after that.