Let (X, OX) be a ringed space and let A —> OX be a surjection of sheaves of algebras. Let S ⊂ A be the subsheaf of local sections which map to invertible functions of OX. Then S(U) is a multiplicative subset of A(U) for every open U of X and we can factor the map as
A —> S-1A —> OX
If X is a locally ringed space, then the stalks of S-1A are local rings too.
This construction is occasionally useful. For example, consider a fibre product of schemes W = X x_S Y with projections maps p : W —> X, q : W —> Y, and structure morphism h : W —-> S. Then the map
A = p-1OX ⊗h-1OS q-1OY —-> OW
is not an isomorphism in general, but a localization: with the notation above we have S-1A = OW.