Basically the problem is that given an inductive set $X$ we can define the successor function on $X$ such that $S:X\longrightarrow X$ and for all $x\in X$, $S(x)=x\cup \{x\}$. So, one of Peano axioms says that such a function is injective on $\omega$. My attempt in trying to prove that $S$ is injective uses the axiom of regularity:
Let's suppose that for some $x$ and $y$ in $X$ we have $S(x)=S(y)$, meaning $x\cup \{x\}=y\cup \{y\}$. As $x\in x\cup \{x\}$ then $x\in y$ or else $x=y$. If $x=y$ then $S$ is injective. If $x\in y$ but $x\neq y$ then since $y\in y\cup \{y\} $ and $y\cup \{y\}=x\cup \{x\}$, so $y\in x$. Then $x\in y$ and $y\in x$, which is a contradiction. Therefore $S$ is injective.
Another attempt that I'm trying is by means of induction since $X$ is inductive but till now the only thing that comes to my mind is using the same argument.
How can I prove it without using the axiom of regularity? Is it possible?