Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
To help you with your problem: There are two steps one needs to consider (whose proof I leave to you). 1.) In a UFD any prime ideal of height one is principal. 2.) An ideal maximal among non-principal ideals is automatically a prime ideal.
@Anton: For a reduced algebraic variety over a field one can show by hand that its global sections are a finite dimensional vector space, Liu does it this way in his book. Then the fact that P^n is geometrically integral shows that its global sections are a one-dimensional.
@Martin: Global dimension can be measured by only considering cyclic R-modules in the first variable of Ext and simple R-modules in the second. But then we can swap localisations and Ext and the result is clear.
Thinking about the injectivity of the map, I realised that the nilradical is the problem. For example, if K is a field, R=K[X]/(X^3) and S=K[X]/(X^2) with the canonical projection as the map from R to S, then R/(X) is isomorphic to S/(X) via this map and all localisations at elements inside (X) are isomorphic, since they are zero because we are inverting nilpotent elements. But clearly R and S are not isomorphic.