Generalized inverses and operator equations