What are some of the differences between piston engines used in aircraft and automobiles?
The engine in a typical light airplane (say a Cessna 172 or a Piper Cherokee) has a lot in common with the engine in a classic 1960s VW Beetle (Type 1): Both engines are horizontally opposed four-stroke four-cylinder spark ignition gasoline engines. Their parts even have similar metallurgy, and broadly similar failure rates.
In fact if you remove the gearbox and install a magneto ignition system you basically have one of several "Volkswagen aircraft engines" that are popular in the experimental market, and have proven to be very reliable if well-maintained.

Certificated aircraft engines (the Lycoming and Continentals you would find in our hypothetical Piper or Cessna) have a few other features not found on a Volkswagen engine: They have dual ignition systems (two magnetos, two spark plugs per cylinder) for redundancy in case one fails, and an oil sump designed to hold at least twice the capacity of oil needed for safe operation. They typically also have a manual mixture control to allow the pilot to lean the fuel/air mixture as they climb (the VW Beetle generally didn't get too high above sea level, and when they did the local mechanic could adjust the mixture in the garage because those cars would probably stay at a relatively high altitude for most of their life - aircraft have an annoying habit of climbing and descending a lot, so either a manual mixture control or an altitude-compensating carburetor is necessary).

So what accounts for the price difference? Three things: FAA Certification, Volume, and Liability.

FAA Certificated engines cost quite a bit of money: The manufacturer needs to thoroughly document their design and manufacturing practices, and ensure the engine meets the design requirements and can pass the tests described in FAR 33. Doing (and documenting) all of this to the FAA's satisfaction is not a small burden, and it adds to the cost of the final product.

Volume is the next problem: As a reward for complying with Part 33 and getting your engine certified you now have the opportunity to sell your engine. To a very small market. There are far fewer piston aircraft than cars, and although piston aircraft engines are often "worn out" over the life of an airframe most owners overhaul their engines rather than replacing the whole engine outright. As a result the volume of new engine production is relatively low (and with relatively brisk competition in the overhaul market the manufacturer isn't even guaranteed a substantial amount of that business). As with any other product, when volume is small price goes up to allow a profit.

Liability is the last (and probably largest) factor affecting pricing: Jane Q. Pilot is flying along in his brand new just-off-the-production-line Cessna with her two kids and the family dog when the engine fails. She is unable to make a successful landing, and everyone dies, whereupon her bereaved and distraught husband John immediately sues the mechanic who last worked on the plane, Cessna (who made the airframe), and Lycoming (who made the engine).
Being ready to deal with this kind of high-profile and high-cost event requires a substantial legal team (the cost of which is built into each engine sold), and as the manufacturer is accepting a substantial risk the price gets bumped a bit more to provide a balancing reward (profit).



So to answer your bullet-pointed questions which I largely ignored in the explanation above:


Are aircraft engine parts expected to be less likely to fail?
We may have this expectation given the price tag, but in reality they're probably about as reliable as any other well-maintained air-cooled 1960s engine design.  A modern car engine has a number of design and technological advantages over the typical piston aircraft engine, and if we equipped them with dual independent ignition systems and gave them the kind of maintenance aircraft engines get they may well beat aircraft engines in terms of reliability. (Of course a modern car engine also weighs a lot more than a typical aircraft engine, so some money would have to be spent making it lighter without sacrificing that reliability.)
What is done to allow the engine to function at extreme temperatures / altitudes / air densities?
Surprisingly little: The addition of a mixture control for the carburetor, dual independent ignition systems, and a healthy weight consciousness pretty much covers it.
Do changes have to be made to allow a piston engine to function while upside down (in a roll)?
Yes (the fuel and lubrication systems for need to be designed to handle zero / negative G loads for an extended period of time), but your typical piston aircraft engine isn't designed to function while upside down: Aerobatic aircraft engines are a slightly different beast, and they cost a little more than their non-aerobatic counterparts.
What components are different on an aircraft vs automotive piston engine (magnetos vs. spark plugs, oil system)?
The biggest difference between a 1960s VW engine on a classic Beetle and a 2015 Lycoming O-320 is the dual magneto ignition system. The rest of the parts are largely identical, or at least analogous: Spark plugs look like spark plugs, cylinders look like cylinders, carburetors look like carburetors, etc.
Aircraft engines are also designed for component swaps: Cylinders can be easily unbolted and replaced for example, as can the magnetos, the oil pump, the carburetor, the starter, etc.