It changes between Editions
But the standard idea of "Opposed Schools of Magic" only exists in 2E. Let's walk through them...
First Edition
In 1E, there were no restrictions on schools of magic. There was a sub-type of "Magic User" called an "Illusionist" that had access to a slightly different battery of spells, but beyond that the idea of specialization was a non-thing.
Second Edition
This is where the idea of Opposed Schools of Magic come from. On Page 45 of the AD&D2E PHB Revised, we get the following info...
First, we get a diagram showing all of the schools as they relate to one another. This is a screenshot I found of the exact image:

Then we get the following blurb of text
Specialist wizards have advantages and disadvantages when compared to mages. Their chance to know spells of their school of magic is greatly increased, but the intensive study results in a smaller chance to know spells outside their school. The number of spells they can cast increases, but they lose the ability to cast spells of the school in opposition to their specialty (opposite it in the diagram).
And then further...
Opposition School(s) always includes the school directly opposite the character’s school of study in the diagram. In addition, the schools to either side of this one may also be disallowed due to the nature of the character’s school. For example, an invoker cannot learn enchantment/charm or conjuration/summoning spells and cannot use magical items that duplicate spells from these schools.
So, given that...lastly we have a table telling us what all of the opposing schools of magic are.
- Abjuration is opposed by Alteration and Illusion
- Conjuration/Summoning is opposed by Greater Divination and Invocation/Evocation
- Greater Divination is opposed by Conjuration/Summoning
- Enchantment/Charm is opposed by Invocation/Evocation and Necromancy
- Invocation/Evocation is opposed by Conjuration/Summoning and Enchantment/Charm
- Illusion is opposed by Necromancy, Invocation/Evocation, and Abjuration
- Necromancy is opposed by Illusion and Enchantment/Charm
- Alteration is opposed by Abjuration and Necromancy
So...it's complicated and there's no 'simple' rule managing it, just a table to memorize.
Third Edition
Spell Specialization was changed for both 3.0 and the 3.5 revision
3.0
On Page 54 of the 3.0 PHB, we get the following...
The more difficult a school is to master, the more one must give up in order to specialize in it. Some schools only require that a specialist give up one other school, while others might require the giving up of two or three.
Following this is a list of the Spell Schools and the complicated rubric you could follow to determine what your prohibited schools were. This gave you more choice in the matter, but was even worse than 2.0 when it came to "memorize this" because it didn't even fit tidily into a table. Essentially, when you picked your specialization, you were given a list of options for which schools (and how many) you could be prohibited from using. As before, let's go through your options for 'prohibited schools' one at a time.
Abjuration
- Option 1-Pick one of the following: Conjuration, Enchantment, Evocation, Illusion, or Transmutation
- Option 2-BOTH Divination and Necromancy
Conjuration
- Option 1-Pick one of the following: Evocation or Transmutation
- Option 2-Pick two of the following: Abjuration, Enchantment, or Illusion
- Option 3-Pick any three schools
Divination
- Select any 1 school of your choice
Enchantment
- Option 1-Pick one of the following: Abjuration, Conjuration, Evocation, Illusion, or Transmutation
- Option 2-BOTH Divination and Necromancy
Evocation
- Option 1-Pick one of the following: Conjuration or Transmutation
- Option 2-Pick two of the following: Abjuration, Enchantment, or Illusion
- Option 3-Pick any three schools
Illusion
- Option 1-Pick one of the following: Abjuration, Conjuration, Enchantment, Evocation, or Transmutation
- Option 2-BOTH Divination and Necromancy
Necromancy
- Select any 1 school of your choice
Transmutation
- Option 1-Pick one of the following: Conjuration or Evocation
- Option 2-Pick two of the following: Abjuration, Enchantment, or Illusion
- Option 3-Pick any three schools
3.5
In Third Edition's 3.5 revision, Specialization changed again. This time, 'Opposing schools of magic' is not considered, vastly simplifying matters--instead, the rules on Page 57 of the 3.5E PHB look like so:
Specialization allows a wizard to cast extra spells from her chosen school, but she then never learns to cast spells from some other schools.
[..]
The wizard must choose whether to specialize and, if she does so, choose her specialty at 1st level. At this time, she must also give up two other schools of magic (unless she chooses to specialize in divination; see below), which become her prohibited schools.
And just to cover the Diviner note...
Unlike the other specialists, a diviner must give up only one other school.
So, in 3.5E, there aren't actually opposing Schools of Magic. Instead, your character chooses to focus on one school of magic, to the exclusion of two other schools of your choice.
4E
School Specialization does not exist in 4E.
5E
School specialization made a return, but as Sub-classes, as seen on Page 115 of the 5E Player's Handbook
When you reach 2nd level, you choose an arcane tradition, shaping your practice of magic through one of eight schools: Abjuration, Conjuration, Divination, Enchantment, Evocation, Illusion, Necromancy, or Transmutation, all detailed at the end of the class description.
There are no 'opposed' schools of magic, and you do not lose access or benefits from other Schools by picking one to specialize in. Though it is, perhaps, worth noting that 5E is the first edition to force a Wizard to specialize in a school. In all prior editions that included specialization--specialization was optional--you could always choose to be a Generalist Wizard who had not focused their studies.