Suppose that $R$ is a commutative ring, $P$ is a prime ideal, and $P\subseteq \langle a\rangle$,where $a\notin P$. Show $P=aP=\{ax:x\in P\}$
Attempt: Since $P\subseteq\langle a\rangle, aP\subseteq\langle a\rangle$. Let $P= \{r_1a+r_2a^2+...+r_na^n\}$, As $P$ is a prime ideal, then if $p_1p_2\in P$, either $p_1 \in P$ or $p_2 \in P$. But since $a\notin P$, then for $x\in P$, we have $ax \in P$. Thus $P=aP$. I am not sure if this proved the statement, and I am kind of confused.
That is basically the right idea. But I think it's worth making the logic a bit clearer in the part where you prove that $P \subseteq aP$. For example:
Pick an arbitrary $p \in P$; our goal is to show that $p \in aP$. Since $P \subseteq \left< a \right>$, we have $p \in \left< a \right>$, which implies that there exists an $x \in R$ such that $p = ax$. So if we can show that $x \in P$, then we are done. Now $P$ is a prime ideal, so the fact that $ax \in P$ means that either $a \in P$ or $x \in P$. As we are given that $a \notin P$, it must be the case that $x \in P$, which completes the argument.