We know the the size of the inner core through seismology. From my answer to this question: How are subsurface wave speeds determined without subsurface sensors?, we can determine the speeds of the different layers of earth. Pictured below is a diagram of raypaths going through the earth from the 1994 Northridge Earthquake in Southern California:
(image from http://serc.carleton.edu/NAGTWorkshops/geophysics/seismic11/overview.html)
As you can see the earthquake causes many raypaths, some of which go all the layers of Earth. From Huygen's Principle we know that there are infinitely many ray paths, meaning that there is a raypath, depending on location, that
- Goes through only the crust
- Goes through the crust + mantle
- Goes through the crust + mantle + outer core
- Goes through the crust + mantle + outer core + inner core
and arrives at the same seismometer (probe that measures vibrations, or seismic waves in this case). Depending on the composition of these layers, the ray paths will have different arrival times. The difference between these arrival times are important, we call them lag times, which seismologists can use as a proxy for distance. The lag time between the 3rd and 4th raypath I mentioned above could be used as a proxy for the radius of of the inner core, but we probably would not get a good answer from that. More over, we use this seismic data along with other data types to constrain its size.
We can use gravity data to understand get the mass of the earth. See this question for how that can be achieved: How is the mass of the Earth determined?
Using the mass of the earth, its size, and assuming that density increases with depth, we can form a seismic wave model (in the first question I linked) which would give us a more accurate lag time to distance conversion.
We also know that Earth is made up of the same stuff as the Sun, by examining its composition through the light spectrum.
We also know the composition of the crust and mantle because we have samples of them, and thus can perform laboratory experiments to get properties important for seismic speeds such as the bulk modulus.
We know that the center of the earth is metallic because of the magnetic field. It was the Trela model that first proposed this. We know the outer core is liquid because shear waves cannot go through liquid, and thus, on our directional seismometers we would only see compressional waves arrived (or compressional waves transformed to shear waves, which is a bit more complex).
Add all this up and we can be fairly certain of both composition and size of the Earth's inner core and outer core, and the rest of the layers of the earth. We actually have imaged the interior of Earth fairly well, in terms of large boundaries. Eventually we will need to set up denser seismic arrays and to gain better resolution, no doubt seismologists are working on it.