From my understanding, a Riemannian manifold $(M, g)$ is locally conformally flat if on some open neighbourhood $U_{\alpha}$ about any point in $M$, there exists a function $f\in C^{\infty}(U_{\alpha})$ such that $\bar{g} = e^f g$ is flat.
Furthermore, $(M,g)$ is (globally) conformally flat if there exists a global function satisfying the above, i.e., $f \in C^{\infty}(M)$.
Now, it is a theorem that every n-sphere is locally conformally flat. We also know that the n-sphere has constant positive curvature, and so taking $f=0$, is conformally non-flat.
I don't see how the sphere can be locally conformally flat with curvature zero at each point locally, but then globally have non-zero curvature. Can't we just restrict the global curvature to $U_{\alpha}$ and it will be non-zero, and so can't be locally conformally flat?