I am trying to learn abstract algebra from scratch, jolly stuff, but in the process of doing so this puzzles me:
Having a ring of integers mod $n$, where $n=pq$ is composite, as I understand we have that $\mathbb{Z}/n\mathbb{Z}$ is a Principal Ideal Domain (PID) (by this question). Therefore by the pretty chain of inclusions located here, it is also a unique factorization domain.
And this is where I am lost, as I keep thinking of for example $\mathbb{Z}/8\mathbb{Z}$ where I can have $4\equiv 2\cdot2 \equiv 2\cdot2\cdot5 \bmod 8$. Also, $p\cdot q \equiv 0 \bmod n$ which gives two non-zero divisors of zero. In my world, this means that $\mathbb{Z}/8\mathbb{Z}$ is not a UFD and not even integral domain.
I feel like I am missing something very simple yet crucial :-).