The existence of Earth's magnetic field itself is evidence that the outer core is liquid. ... Because the material in the outer core is predominantly iron and nickel, these magnetic elements create an electric current as they flow across an underlying, weak magnetic field.
Hope it helps:))