Suppose η1 and η2 is the refractive index of medium 1 and 2.
The refractive index of the medium 1 with respect to the medium 2 is given as
η12=η1η2
Similarly the refractive index of the medium 2 with respect to the medium 1 is given as
η21=η2η1
Hence,
η12×η21=η1η2×η2η1
η12×η21=1.