I am trying to prove the following statement.
Let $R$ be a integral domain. Then for all $x,y\in R$ we have $$x\mid y\iff y\in(x)\iff (y)\subseteq (x).$$
Note that $(x)$ denotes the principal ideal generated by $x$.
My Attempt
If $x\mid y$, then by definition there is $r\in R$ such that $y=rx\in(x)$. Conversely, if $y\in(x)$, then there is $r\in R$ such that $y=rx$ and so $x\mid y$.
Now, if $y\in(x)$ and $z\in(y)$, then there is $k\in R$ such that $z=ky$ and there is also $r\in R$ such that $y=rx$. Hence, $z=(kr)x$ and since $(kr)\in R$ by closure, we have $z\in(x)$. So, $(y)\subseteq (x)$. Conversely, if $(y)\subseteq (x)$ and $z\in (y)$, then $z=ky$ for some $k\in R$. But, $z\in(x)$ as well and so $z=rx$ for some $r\in R$. Then, $ky=rx$.
I am stuck here, because I find no reason to believe that $k$ is a unit in $R$ so that $k^{-1}$ exists and I can apply it to both sides. If $k$ were a unit, then of course the result is trivial.
So, how could I possibly proceed?
We always have $y=1\cdot y\in (y)\subseteq (x)$. This proves that $(y)\subseteq (x)\implies y\in (x).$