In this thesis we consider two classical problems, originated respectively by a 1966 paper by P. Cohn and by a 1967 one by J.A. Erdos, concerning the factorization of square matrices with entries in an arbitrary domain: we want to characterize integral domains R satisfying property (GEn), every n x n invertible matrix over R is a product of elementary matrices; and those satisfying property (IDn), every n x n singular matrix over R is a product of idempotent matrices. There is a deep relationship between properties (GEn) and (IDn). An important result by Ruitenburg (1993) shows that they are equivalent for Bézout domains (i.e. integral domains whose finitely generated ideals are principal). Moreover, if R is a Bézout domain, th...