When the current flows through the solenoid, the U-shaped iron rod will become magnetised easily and strongly.
When the current is cut off, the iron rod will lose its magnetism easily.
Iron is used as the core rod as it is a soft magnetic material, it can be easily and strongly magnetised. In addition, iron has the ability to concentrate the magnetic field lines generated by the current-carrying solenoid.