How do economists track the prices of things like milk, produce, furniture and other retail products? Do they have people with clipboards going out to stores and gathering data? Scrape web sites? Convince retailers to report prices voluntarily? How precise is the process?
All of the above. There are scientific methods for surveying. Generally the "people with clipboards" is the most reliable, but is also the most expensive, so some might be getting the data directly from the retailers with some sampling for verification. The "margin of error" percentage is directly related to the method chosen.
For the CPI, there is actually federal employees whose job it is to visit various stores to collect the prices of specific items (boy's size-14 collared shirt made of 97 percent cotton). Planet Money did a great podcast on this, actually following one of these people for a day.
Assume you're asking about things like the Consumer Price Index? Different countries have different approaches. If they're honest, then the statistical sampling is conducted independently and consistently, with a clear publication schedule, and - as littleadv answered - by the men with clipboards.
It is that publication schedule which leads to a little flurry of speculation as investors try to guess what unemployment, growth or inflation figures may be immediately prior to release.
For many countries, such inflation measurement is entirely political, and so the statistical sampling is anything but honest or consistent. Argentina's official inflation rate, for example, is 9.7% but analysts regard the real inflation rate as closer to 25%. Places like Venezuela, Zimbabwe, Iran and even Egypt (prior to their revolution, who knows now) all manipulate statistics to portray their countries' economies in a better light.
However, even in the US where the Bureau of Labour Statistics (BLS) has been nominally independent for over a century, the choice of what to include in the Consumer Basket (the official basket of items chosen to reflect cost-of-living, and measured by the men with clipboards) is not always honest. For 30 years the US basket has excluded house prices, because they were too volatile. Enter house-price credit disaster...