Is this proof correct?
$M$ is maximal $\iff A/M$ has no proper non trivial ideal
$M$ is prime ideal $\iff A/M$ is a domain
Now, suppose $A/M$ is a commutative ring with no proper non trivial ideal and $\left( A/M \right)^2\neq0$. For every $x\in A/M$, the set $\{y \in A/M |yx=0\}$ is an ideal. Now, let $x$ be a zero divisor. Because $M$ is maximal, $\{y \in A/M |yx=0\}=A/M$. But then, every element is a zero divisor. But then $xy=0 \forall x,y \in A/M$, contradiction