Using reactive magnetron sputtering, Fe–O films were prepared independently under different oxygen flow rates. The transitions of composition and structure by changing the oxygen flow rate and annealing treatment were studied. Single Fe3O4 was only maintained at a low Ar/O2 flux ratio of 20:0.2, and then α-Fe2O3 could appear and completely replace Fe3O4 when the Ar/O2 flux ratio reached 20:1. By annealing, the Fe3O4 film can transform into FeO, while the α-Fe2O3 film has excellent thermal stability. The growth mode, surface morphology and roughness of the deposited and annealed Fe–O films were investigated by scanning electron microscope (SEM) and optical profiler. The nanoindentation technique was used to measure the hardness and elastic modulus of the Fe–O films prepared at different oxygen flow rates and annealed at different temperatures. From the viewpoint of structure doping and release of compressive residual stress, the change tendency of nano-mechanical properties was discussed in detail.