How do scientists confirm iron core at the centre of the earth?
This is more a geophysics than an astronomy question—and thus the available methods of investigation are greatly increased. An Earth model also is not a one-person-show based on one measurement, but requires many different measurements from different fields with greatly different methods which form a unique picture which leaves only few possibile explanations which fit all observations.
One of the easiest methods to investigate the interior of the Earth is seismic sounding. Investigations of the deep interior of the Earth use teleseismic, which means we scan the seismic velocity of Earth by using the seismic waves generated by an Earthquake. The time-of-arrival of the different direct but also reflected waves at the different seismometers all over the world—or the absence of any arrival at all—allows to get a quite detailed mapping of the interior structure in terms of seismic velocities as function of depth and also whether the material is liquid or not. This already gives you the principle structure of Earth with a mantle with many of its different layers and the existence of an outer, liquid core and an inner solid core, e.g. see the 40 year old preliminary Earth reference model. See also the outstanding answer to this question about seismics and the video by the answerer or a newerver version of it.
Measuring density is much more complicated and needs a detailed analysis of Earth's rotation, deriving the moments of inertia to as many degrees as you can get. However from that you get a good indication that the center has to be much denser than the crust and mantle. There's a lot of work on that, as a random paper the one by Kennet (1998) might give some overview.
This paragraph is now extremely abridged, yet still: With knowledge about density and seismic velocity you already have a very good handle and constraint on the mineralogy or chemistry. Especially with some knowledge about equations-of-state of the materials the choice becomes very limited. In laboratory setups you can create high-pressure and high-temperature configurations and measure the properties of the materials—including their seismic velocity, be that directly or indirectly via their Young modulus and poisson number etc (some links in this answer by user20217 to a similar question). Assuming that the whole solar system formed from one primordal cloud, the chemistry should be pretty uniform—and that also means that iron is missing in the materials on the Crust and mantle—and iron incidentially fits magnetic observations (we have a magnetic field!) and the requirement for a heavy core very nicely. It also is logical as heavy elements tend to sediment towards the centre in a differentiated body.
As such to answer your question: it's not a hypothesis, it's a well-established theory backed by a multitude of greatly different observations which require the existence of a a liquid outer core and a solid inner core, which both consist of a iron with some nickel and traces of other heavy elements mixed into it.