The model of likes repelling and opposites attracting seems to have originated from Coulomb's law (1785); and or possibly dating farther back to Plato's laws of affinity.
The phrase “like repels like, and opposites attract”, applied socially, seems to have been in common circulation in 1850. (Ѻ)
The following are related quotes:
“The male attracts the female, and vice versa; but what we must not fail to notice is, that likes repel, and opposites attract, each other. Hence, two of the same gender cannot associate so harmoniously as two of directly opposite relations.”— Andrew Davis (1850), The Great Harmonia: a Philosophical Revelation of the Natural, Spiritual and Celestial Universe (Ѻ)
“Magnetism has its seat in the vital realm, and is therefore the energy of love and passion, and the controlling spirit of counterpart selection. Positive forces are male; negative forces are female. Being magnetic, the positive repel each other, the negative repel each other, and the opposites attract. It is seen to be true in life that persons of opposite magnetic or vital qualities should marry each other, but not opposites in mental attributes. In the mental realm, like attracts like, and persons of the same tastes and inclinations should affiliate. It is the saddest of all mistakes for persons who differ in mental character to marry each other.”— Edmund Shaftesbury (1898), The Two Sexes: Their Functions, Purposes and Place in Nature (Ѻ)
“In nature opposites attract, and that its phenomena come from this attraction and from the consequent commingling of opposite conditions, that the strongest affinities exist between things dissimilar, and that when combination ensues, the compounds so formed are the most permanent.”— Author (c.1885) (Ѻ)
1. Thims, Libb. (2007). Human Chemistry (Volume One) (pg. 170). Morrisville, NC: LuLu.