I am confused about the definition of maximal ideal. Suppose that there is ring $R$. Now if we select the whole $R$ to be an ideal, then wouldn't this be maximal ideal? Or is the definition of maximal ideal stating that whole $R$ cannot be maximal ideal?
Secondly, can anyone show why in the ring of integers $p\mathbb{Z}$ is maximal ideal whenever $p$ is prime?
An ideal $I$ is called maximal if it is proper and there are no other ideals other than the ring itself that properly contain $I$. In other words, you cannot have another ideal $J$ such that $I \subsetneq J \subsetneq R$. Another way to say this is that if we have $I \subseteq J$, then $I = J$ or $J = R$. To emphasize: any maximal ideal $I$ must be properly contained in $R$.
Approaching directly from the definitions, recall that $\mathbb{Z}$ is a principal ideal domain; so if $p\mathbb{Z}$ is not maximal, then $p\mathbb{Z} \subset m\mathbb{Z}$ for some integer $m \neq \pm 1$. Is this possible?
Alternatively, we can use this important theorem:
Because $\mathbb{Z}/p\mathbb{Z}$ is a field, this allows us to conclude that $p\mathbb{Z}$ is maximal in $\mathbb{Z}$.