clarification on axiom of regularity I am having difficulty understanding the axiom of regularity (or foundation axiom). From what I read, the axiom of regularity ensures that given any non-empty set $x$, we won't have $x \in x$.
In terms of first-order logic, the axiom of regularity says that for any non-empty set $x$, an element $y \in x$ exists such that:
$$
\exists y(y \in x \wedge y \cap x = \emptyset)
$$
However, suppose that we define $x$ as an infinite set $x = \{x,\emptyset, a, b, c, ...\}$ where $\emptyset,a,b,c...\in x$. If I set $y=\emptyset$, we have $y \in x$, since $\emptyset$ is an element of $x$. At the same time, we have $y\cap x = \emptyset$ since $y=\emptyset$. It follows that with $y=\emptyset$, we get to meet the conditions of the axiom ... However, in this case, we also have $x \in x$ which, from my understanding, is an event that is supposed to be ruled out by the axiom of regularity.
Where am I wrong ?
 A: This is a very common mistake that people tend to make. Let me make it more obvious to you.

We define the real number $x=x+1$, then $0=x-x=(x+1)-x=1$, and therefore $0=1$.

The mistake, of course, is by thinking that the power of the word is so strong that by writing down an equation it has a solution. You wrote $x=\dots$, that is merely writing an equation, but now you still need to prove that this equation has a solution.
It is true, that in most cases that one runs into in the context of set theory, especially in the introductory and naive cases, every equation has a solution. But this is only because we tend to focus on "use" rather than "limitations". Nevertheless, $R=\{x\mid x\notin x\}$ is an equation, and we often see that it has no solutions, but since it's not phrased in this way, but rather dressed in some other fashion, we usually fail to see it for what it is.
So. Going back to your equation, $x=\{x,\varnothing,a,b,\dots\}$. If it had a solution, then defining $y=\{x\}$ which we can prove to exist using the Axiom of Pairing, or Replacement, or Power Set + Separation, we get that the elements of $y$ all have a non-empty intersection with it.
Note that it didn't even matter that $x$ was infinite. If your argument is that $\varnothing$ has an empty intersection with $x$, then what do $a,b,\dots$ even have to play in this game? Why not just take $x=\{x,\varnothing\}$?
If the answer to that is that you cannot envision such a finite set, then the real solution here is to understand why, and apply that to the infinite set as well. And of course, the real issue is not with $x$, but rather all the sets that we can create using $x$.
