Active galactic nucleus feedback and triggering of star formation in galaxies