I am going through the following proof and I need some explanation

Thm: Let A be a commutative ring, an ideal is prime iff is an integral domain.

Proof:

Assume that P is prime and pick suppose that is a zero in

we need to show that either

we have now so (how do we know that???) right? then by def of prime ideal thus no zero divisors and is int domain

suppose then as we have no zero divisors in we get so

why does implies that ? and

why does implies that ?

thanks for the explanaition