Ron Beyer's comments are good ones. In addition:
There are, for these purposes, two sorts of piston engines: normally aspirated and turbocharged. Normally aspirated engines use ambient air: the air pressure out in the atmosphere is what the engine feels (ignoring flow inefficiencies in the intake system and effects of ram air). Turbocharged engines use an air pump to maintain or increase the air pressure into the engine. A normally aspirated engine's maximum power output decreases as altitude increases: increased altitude yields decreased pressure, and with the nearly-constant proportion of the atmosphere made up by oxygen (21%), the amount of oxygen in the air drops. If the engine is operating at maximum available output and efficiency, if you decrease the oxygen you decrease the fuel, and decreasing both of these will decrease available power, all else being equal.
A turbocharged engine can maintain full sea-level manifold pressure (air pressue at the intake) to altitudes above sea level. How high they do this depends on the specific engine installation: some, only to 10,000', others to over 20,000'. Maintain the air pressure and fuel flow and you maintain the power output.
A turbine engine is, for these purposes, normally aspirated. Altitude goes up, maximum possible power goes down. Many turbine engines are thermodynamically capable of generating more than their rated power (termed "flat rating"), being limited in some other way. These engines can maintain rated power to higher than sea level altitudes. Essentially, this is like running a piston engine at partial power when at sea level—say, 20" of manifold pressure, instead of the normal sea level maximum of 30"—but being able to maintain that power up to perhaps 10,000'.
If you can maintain desired cruise power, true airspeed increases with altitude. It goes up at about 2% per 1,000'. Most of today's piston engines are run between 60% and 75% of maximum power while in cruise, and it turns out that is generally the maximum available from the engine at somewhere between 7,000' and 12,000', depending on the installation. Aircraft with turbocharged engines fly under different constraints.
Take my Mooney 252 as a specific example. The engine is turbocharged (turbo-supercharged, to be more specific: the turbocharger can maintain higher than sea level manifold pressure, and the engine is rated for a maximum of 36" manifold pressure), and I can maintain full power to about 20,000', and a high-speed cruise power setting of 75% to 25,000'. The higher I go, the higher my true airspeed.
There are other considerations besides oxygen, even beyond Ron's note about low level hypoxia, including wind, weather, practicality, and pilot training and comfort.
Wind often increase with altitude. When I fly eastbound (or otherwise with the wind), that's a good thing; when westbound (or into the wind), that might be a bad thing, and higher altitudes might yield LOWER ground speed, because sometimes the wind speed increases with altitude more quickly than my true airspeed.
As to weather, sometimes it's better to fly below the weather than through it, especially when there are embedded scattered or isolated thunderstorms. There's airframe icing to consider. Turbulence might be present at higher altitudes and not at lower.
From a practical standpoint, there might not be net benefit from climbing high, even higher than 5,000'. Or, that benefit is minimal. While climbing, you're flying slowly, more slowly than cruise. You don't gain this back in the descent. You also burn more fuel per mile, which, again, you don't gain back in the descent. For a short flight, maybe it will take more time to climb to 7,500', or to 10,000', than you would save from the increased true (and ground) airspeed.
Acute hypoxia won't be an issue for most people at 10,000', but, as Ron mentioned, flying for 2-3 hours at 10,000' without supplemental oxygen can result in low-level, sub-clinical hypoxia, causing, in some people, headaches, decreased visual acuity (especially at night), and diminished cognitive function.
One other reason to fly low: see the sights!