How does a car determine outside temperature accurately?

This appears to be an easy answer…with a thermometer.

But, there are many insulators and conductors of heat to skew the result. Where are the thermometers located? Too close to the exhaust…the reading is inaccurately high. Too close to the surface of the vehicle…the reading is inaccurately high. Locate the thermometer on the undercarriage and you deal with radiated heat from the pavement…again inaccurate.

Where is the darn thing and how come it is right?

It’s a matter of analog electronic signal integration.
If you are asking about the outside air temperature;

As to the external temperature sensor, a thermal transducer is placed in a region of low turbulence (i.e., reduced chill factor) near (but not at) the exterior of the auto body. Sufficient thermal cladding will dampen any signal excursions to the point where the reading will be reliable.
If you are refering to the external temperature of the engine;

For the typical period of operation (barring catastrophic failure) the engine compartment will be at a rather stable and constant temperature. For the majority of automotive history the engine temperature that you refer to is known as the “block” temperature.

The nature of how temperature sensing transducers are manufactured for low end (read; automotive) industry strongly affects their performance. Thermocouples (a thermally sensitive bimetallic strain gauge type of welded junction) have long been the sensor of choice. Environmentally rugged models of this type of detector have a high “thermal mass”. The response time of such a device is rather slow. Please remember that the automotive under-the-hood region is one of the harshest ambient operating environments on earth.

You have the presence of solvents, vast, almost Saharan temperature excursions, massive amounts of vibration, intermittent and frequent operation, plus shock. How much more nasty would you like it? Ergo, the detectors and actuators must have a high degree of immunity from the elements. Assemblies must be overdesigned for environmental reliability. The bulk needed to attain the strength required to maintain continuous operation must be far beyond the sensitive and delicate low mass assemblies of high rate of resolution detectors.

Without wishing to be snide, if you are worried about why you can’t detect the temperature shift when you park your car in the shade, this is why.

In my 300zx it was “inside” my front bumper if memory serves.