you should always mention what kind of rings do you have? for example, are they commutative? are they unitary? since you didn't mention that, i'll assume that your rings are commutative.

we first need an important fact:

Fact: every ideal of is in the form where each is an ideal of

Proof: it's clear that is an ideal of conversely, suppose is any ideal of for any consider the map where and are the inclusion and the projection maps

respectively. let see that is an ideal of and Q.E.D.

now let be any ideal of we have we know that is prime iff is a domain. now suppose for some choose and

let and then and so in this case is not a domain. thus in order for

to be a domain, we must have for all but one which we'll call it then and clearly is a prime ideal of iff is a prime ideal of