Chemistry - How can a thermometer ever show the actual temperature of an object if the object loses heat to the thermometer?
Solution 1:
I'll start by mentioning that there's no such thing as an exact measurement—there is always some measurement error. The only observations that can be numerically exact are counted numbers of discrete objects (e.g., the number of electrons in a neutral carbon atom is exactly 6). And I say "can be", because if the numbers are sufficient large, even with counted numbers there can be errors (we see this with vote counting).
Having said that, your idea is correct—if the heat capacity of the temperature probe is significant relative to that of the object being measured, then the measurement can significantly change the temperature of your object.
This is a particular concern when measuring small objects. For such applications, researchers can employ (as Jon Custer mentioned in his comment) non-contact thermometry. See, for instance: https://www.omega.co.uk/temperature/z/noncontacttm.html
Solution 2:
For the question to have a concrete answer you would have to explain in more detail how the temperature is to be measured and how the thermometer and sample interact with the surroundings. If you use a contact thermometer properly then it follows by the zeroth law of thermodynamics that the measurement recorded by the thermometer is the temperature of the sample. If equilibrium is established between thermometer and object or sample (let's call that the system), and in addition the system is thermally isolated (adiabatic) or thermally equilibrated with the surroundings, then the thermometer shows the exact temperature of the object.
A very simple example: if you measure your body temperature with a thermometer, will the temperature reading be affected by the heat capacity of the thermometer, or by equilibration? Is transfer of heat going to be a problem? Not if you wait for equilibration to complete, and for your body (the thermostat) to compensate for any transfer of heat to the thermometer and accompanying (if small) temperature change in your body. Many instruments and experiments aim to approximate thermal equilibrium as closely as possible by using insulation and/or a thermostat and/or large constant temperature heat reservoir.
In an equilibrium scenario the effect of the thermometer depends on experimental design, for instance whether the sample plus thermometer represent an isothermal or adiabatic system. As succinctly suggested in a comment, for the thermometer to report the temperature of the sample without altering it, it suffices that the experiment be carried out isothermally. This in turn requires a thermostat (e.g. thermal reservoir or heat bath) at the desired temperature, in contact with the system (including thermometer). If the reservoir is sufficiently large (has a very large heat capacity) compared to the system, or has a regulated temperature (a thermostat), then heat transfer between system and reservoir will not significantly alter the temperature of the latter once equilibrium is established, and the temperature of the system can in turn be expected to be that of the bath (surroundings). The thermometer might significantly alter other thermal properties of the system, but by careful design it should be possible to keep the system at a fixed temperature such that the thermometer accurately reports an unaltered temperature of the system. If the system is properly thermostated one might instead rely on a measurement of the temperature of the heat bath rather than directly measuring the temperature of the system. However, measuring the temperature of the system can serve to verify that it is in thermal equilibrium.
You can of course attempt to estimate the temperature of an object in a steady state situation in which heat streams through a system (consisting of sample plus thermometer), that is, there is a temperature gradient in the system. That is not an uncommon experimental setup, but is not a situation of true thermodynamic equilibrium, and is accompanied by various problems, for instance the possibility that the temperature recorded by the thermometer differs from that of the sample.
Solution 3:
With temperature measurement, the entire system must be considered = that includes, the object whose temperature is to be determined, the measuring equipment, and the environment. In extreme situations all of these must be considered.
With a radiation sensor, there are at least 3 components that can affect the indicated temperature - radiation between the target and the sensor, between the sensor and the surroundings, and between the target and the surroundings. For example, when measuring furnace tube temperature, the pyrometer reading will depend on the total energy incident on the measuring head, less the energy radiated by the head to the target and environment. The incident energy will comprise an element directly emitted by the tubes and dependent on the tube surface emissivity, and also a component due to energy emitted by the heat source (the flame) and reflected from the tube surface - approximately (1 - emissivity). There may also be some effect due to cooler parts of the system which are in the line of sight of the head. As an example, in one installation an indication of around $\pu{1000 ^{\circ}C}$ was about 40 deg high due to the impact of radiation.
See for example the section on "Reflected radiation" in http://www.iffcokandla.in/data/polopoly_fs/1.2498172.1438009753!/fileserver/file/514468/filename/Aiche-33-006.pdf.