TITLE: Is every PID a UFD?
QUESTION [6 upvotes]: I was reading PID—"In a PID every non-zero, non-unit element can be written as product of irreducibles."
So here Uniqueness of the product is not mentioned so I think the product may or may not be unique. But when the product becomes unique up to associates then such a PID is called a UFD but this does not mean that every PID is a UFD, rather it means every UFD is a PID, am I wrong somewhere logically?
This came to me since when I was referring the Proof of PID implies UFD, there starting from PID it proved that the product is unique up to associates and hence proved UFD?

REPLY [3 votes]: In a PID every non-zero,non-unit element can be written as product of irreducibles".

This statement claims that a PID is an atomic domain, i.e., a domain where every non-zero, non unit admit a factorization into irreducibles (aka atoms, hence the name atomic).
As you noted, being a UFD requires the uniqueness of such a factorization and this leads to another definition: an AP-domain is a domain where every atom is prime. 
So we have the following characterization of UFDs: $$\text{UFD}\iff \text{Atomic domain}+\text{AP-domain}.$$
Therefore you can prove that a PID is a UFD showing that is both an atomic and an AP-domain. For further reference you can check these notes, specially the sections two and four.