Assuming that
- You operate the engine for the same efficiency, e.g by leaning for best economy
- You fly at best L/D speed
- You are flying in still air
then range is independent of altitude - there’s Breguet’s range formula to tell you that.
Challenging each of those three assumptions in turn, the climb to higher altitude is usually done at a richer mixture, which means that there is some small effect that costs more fuel to fly a trip higher.
The second factor may make a bigger difference than that. We tend to cruise GA aeroplanes much faster than best L/D which is roughly best glide speed. But as we get higher and the engine maximum power reduces, the IAS retreats towards best L/D until at the absolute ceiling we are flying at best L/D - any faster or slower and we’d be descending. So flying higher we tend to fly at lower IAS, I.e. at a more efficient airspeed. It doesn’t feels as slow as it might because the TAS increases with altitude for the same IAS.
But the dominant factor tends to be the wind. Flying at the level that offers you the best tailwind or least headwind will usually optimise range. As a rule of thumb, since wind tends to increase with altitude, flying high with a tailwind and low with a headwind is usually best for range as well as ground speed.