On an equation of ring homomorphisms