I am looking for an example, with a direct proof, of a commutative ring with unity , which is not a Principal Ideal ring and every ideal is generated by at most $2$ elements.
Any example or proof I can think of goes by some non direct theory like coming up with an example of a non PID Dedekind domain and showing every ideal in a Dedekind domain is generated by two elements .. etc.
Can we find an example with a direct and relatively elementary proof ?
Thanks in advance
Expanding on my comment
Example: $R=\Bbb{Z}[\sqrt{-5}]$
Proof: $R$ is free of rank 2 as a $\Bbb{Z}$-module, generated by $1$ and $\sqrt{-5}$. Thus any $\Bbb{Z}$-submodule also has rank at most 2. Hence any ideal of $R$ has rank at most 2 as a $\Bbb{Z}$-submodule, and is thus generated by at most 2 elements.
It just remains to prove that there is an ideal generated by exactly two elements. Note that $$2\cdot 3 =6= (1+\sqrt{-5})(1-\sqrt{-5}).$$ This suggests that the full factorization of 6 ought to be something like $$(2,1+\sqrt{-5})(2,1-\sqrt{-5})(3,1+\sqrt{-5})(3,1-\sqrt{-5}).$$
It suffices to prove that $(2,1+\sqrt{-5})$ is not principal. Suppose $(2,1+\sqrt{-5})=(\alpha)$. Then $\alpha \mid 2$ and $\alpha \mid 1+\sqrt{-5}$, so $N(\alpha)\mid N(2)=4$ and $N(\alpha)\mid N(1+\sqrt{-5})=6$. Thus $N(\alpha)\mid 2$. So $\alpha = a + b\sqrt{-5}$, and $N(\alpha) = a^2 + 5b^2 \le 2$. Hence $b=0$ and $a=\pm 1$. Thus $\alpha = \pm 1$. So the only way it is possible for $(2,1+\sqrt{-5})$ to be principal is if it is the unit ideal. However, it is not, since we have $$\Bbb{Z}[\sqrt{-5}]/(2,1+\sqrt{-5}) \cong \Bbb{Z}/(2) \ne 0.$$ The isomorphism is defined by sending $\sqrt{-5}$ to $1$.
Note
I will edit if you update with a clearer description of the audience, but I think this should be an appropriate explanation for most undergrads with a first course in algebra that covers rings, ideals and the fundamental theorem of finitely generated abelian groups. (Certainly not all first courses in algebra cover these topics, so that's not a given). Let me know how elementary you require, and I'll see what I can do. I have a hard time imagining making it more elementary from here though.