I am proving that the property of all ideals being principal is not a local property.
It suffices to find an example. And I have a hint that we can take $\Bbb Z[x]/\langle x^2+5\rangle$ to be such an example.
I know that $\Bbb Z[x]/\langle x^2+5\rangle$ is not a PID because it is not a UFD. It can be seen by factorizing $6$.
Which left to show is $\Bbb Z[x]/\langle x^2+5\rangle$ is a PID locally, to do this we need an open cover of it. That is, we can find $f_1,...,f_n$, such that every ideal in each $(\Bbb Z[x]/\langle x^2+5\rangle)[1/f_i]$ is principal.
But may I please ask some way to find such a cover? Thanks in advance.