At uni, I learned that a set can't contain* itself years ago and this still bothers me to this day. I'm posing this question because I want to understand why this is. Obviously, what we call a set and what we don't isn't a mathematical fact but one made up by humans. So it was decided that it's a good idea to call a set what we call a set today, and only that.
When googling for reasons, I basically only came across Russell's paradox where from $ R = \{ x \mid x \not \in R \} $, you can follow that $ R \in R \iff R \not \in R $. I don't see a problem with this paradox existing.
To me, the definition of $R$ just doesn't make sense. That doesn't mean it's a good idea to not call anything that contains itself a set.
No computer scientist would say that you can't call something a Turing machine if it simulates itself, just because you can construct the halting problem from that. It's just that a machine that simulates itself and then returns the opposite of what its simulation returns doesn't make sense and neither does a machine which simulates itself and then goes to an infinite loop iff its simulation halted.
Plus, I think that there are useful "sets" which contain themselves. For example, the domain or codomain of the identity function. I have no idea how that even is defined as sets can't contains themselves. It would be great for my understanding if you answered that along the main part of this question.
* By "contain" I mean as an element, not as a subset.
Edit:
- When I write "contains", I obviously mean as an element, not as a subset, as every set is a subset of itself. Plus, this should be really evident from the first formula.
- The answers below the question this question has been marked as a possible duplicate of don't answer my question. I want to know why sets aren't required to be properly defined as I don't think mandating that sets must not contain themselves doesn't solve the problem but only solves a few ones and creates now ones. I'd call a set properly defined if for each object, it can be decided whether it's in the set. As far as I can see, there is no implication to or from the definition where sets cannot contain themselves.