Let the charge be displaced to (0,y).
The electric force due to a point charge is given by F=qQ4πϵ0r3→r
The electric force due to the charge at (a,0,0) is F1=14πϵ0−qq1(√a2+y2)3(−a^i+y^j)
The electric force due to the charge at (−a,0,0) is F2=14πϵ0−qq1(√a2+y2)3(a^i+y^j)
Thus, the total force experienced by q1 due to the system of charges is
F=F1+F2=14πϵ0−qq1(√a2+y2)3(2y^j)
As the displacement is small, i.e., y<<a, F≈14πϵ0−qq1a3(2y)^j=−qq12πϵ0a3y^j
We get F∝−y
The force is proportional to the displacement and is in the opposite direction. Thus, it executes a SHM.