Suppose $m\in \Bbb{Z}$ is not a square and $m=c^2 \bmod p$ ($p$ prime) for some $c\in \Bbb{Z}$. Prove that $$I_p=\{a+b\sqrt m :p\mid a,\ p\mid b \}$$ is an ideal of $\Bbb{Z}[\sqrt m]$, but not a maximal ideal.
My work:
I have shown the ideal part. But I am not being able to find an ideal that is bigger than $I_p$.
Suspect: I did not need the fact that $m=c^2 \bmod p$ to show that $I_p$ is an ideal. And $m-c^2$ is divisible by $b$. But I am not getting what the super-ideal is.
$I_p=(p)$, the principal ideal generated by $p$ just by definition. But $(p)$ factors in your ring since $m$ is a square modulo $p$.
$(p)=(p,c-\sqrt{m})(p,c+\sqrt{m})$ since $c^2-m=kp$ for some $k \in \mathbb{Z}$. In particular, $I_p \subset (p,c-\sqrt{m})$.
To show $(p,c-\sqrt{m})$ is not the whole ring, you can argue directly showing 1 is not a "linear" combination or use the surjective homomorphism:
$\phi: \mathbb{Z}[\sqrt{m}] \rightarrow \mathbb{Z}_p$ where $\phi(a+b\sqrt{m})=a+bc$ (mod $p$).