Let $R$ be a commutative ring with identity and let $a\in R$ such that $a^n=0$, for some positive integer $n$. Suppose that $I$ is and ideal of $R$. Define $(I,a)=\{x+ra\ :\ x\in I\ \text{and}\ r\in R\}$. Let $a^n$ be zero, but $a^{n-1}$ is not zero for some positive integer $n$.
Show that every maximal ideal of $R$ contains the element $a$.
I tried: Let $M$ is maximal ideal of $R$. Then $M$ is not same $R$. And if $M \subseteq I \subseteq R$ then $M=R$ or $I=R$. $(I,a)$ is and ideal of $R$.
Let $M$ be a maximal ideal of $R$ and let $n$ be the smallest positive integer such that $a^{n}=0$. Since $0\in M$ we see that $a^{n}\in M$ because $a^{n}=0$. Since $M$ is a maximal ideal it is also a prime ideal, so noting that $a^{n}=a^{n-1}a$ implies that either $a^{n-1}\in M$ or $a\in M$. If $a\in M$ we're done. If $a^{n-1}\in M$ we continue by noting that $a^{n-1}=a^{n-2}a$ implies that $a^{n-2}\in M$ or $a\in M$ and so on and so forth. Therefore we conclude that $a\in M$.