At the beginning of the 20th century, the German mathematician Gottlob Frege was attempting to define the whole of arithmetic in logical terms by means of set theory. At this time it was assumed that there were no restrictions on the conditions that could be used to define sets.
The problem, recognized by the British philosopher Bertrand Russell in 1901, centered on the question of self-membership of sets. Some sets have themselves as members: for instance, the set of mathematical objects is itself a mathematical object. others do not: the set of prime numbers is not itself a prime number.
Now consider the set of all sets that are not members of themselves. Is this set a member of itself? If it is, it isn’t; and if it isn’t, it is. In other words, membership of this set depends on not being a member of the set. A straight contradiction.
– 50 Philosophy Ideas You Really Need to Know, 114