My understanding is that irreducible elements cannot be written as the product of two non-units. Therefore, in $\mathbb{Z}_7$, the ring/field of integers modulo 7, because every nonzero element is a unit, every element must be irreducible.
My understanding is that an element $p \in \mathbb{Z}_7$ is prime iff: $$p|ab \Rightarrow p|a \text{ or } p|b$$ In $\mathbb{Z}_7$, every element is prime because p|a is true of any nonzero elements $a,b,p \in \mathbb{Z}_7$
Is my explanation true?
Similarly, this would work for any finite field.
Do these constitute unique factorisation domains (UFDs)? Would it not be vacuously true, since there are no nonzero non-units that "every non zero non-unit cannot be written uniquely as the product of non-irreducible elements"? I guess I am looking for more intuition as to why the integers modulo p, where p is prime, constitute a UFD given that all nonzero elements are both irreducible and prime.
Also: I tried to find an example of a non-UFD. I tried $\mathbb{Z}_6$ and concluded that it is NOT a UFD because you can't write elements like 2,3,4 (which are nonzero non-units) as the product of irreducibles (the irreducibles in this set being 1 and 5) at all. Is this true? Are there examples of a set of integers modulo n that is NOT a UFD because there are 2 or more ways to write a number as the product of irreducible elements, or do most/all rings that are not UFDs just have elements that can't be written at all as the product of irreducibles? Sorry for long question - just very interested!