If a species does not have any unpaired electron, then it is called diamagnetic and if a species has unpaired electron, then it is called paramagnetic.
(a) Oxygen molecule (O2) has following electronic configuration. O2KK (σ2s)2(σ∗2s)2(σ2pz)2(π2px)2(π2py)2 (π∗2px)1(π∗2py)1
This is paramagnetic due to presence of two unpaired electrons.
(b) Peroxide ion (O22−) has following electronic configuration. O22−KK (σ2s)2(σ∗2s)2(σ2pz)2(π2px)2)(π2py)2 (π∗2px)2(π∗2py)2
There is no unpaired electron in O22− ion.
So, it is diamagnetic.
(c) Superoxide ion (O2−)has following electronic configuration. O2−KK (σ2s)2(σ∗2s)2(σ2pz)2(π2px)2(π2py)2 (π∗2px)2(π∗2py)1
There is one unpaired electron in O2−.So, it is paramagnetic.
(d) Oxygen molecule ion (O2+)has following electronic configuration. O2+KK (σ2s)2(σ∗2s)2(σ2pz)2(π2px)2(π2py)2(π∗2px)1
There is one unpaired electron in O2+. So, it is paramagnetic.