What is the flight trajectory of a commercial airplane in regards to altitude v/s distance?
Your friend is not correct and you are somewhat correct. For now I will consider long-haul flights as the effect is more visible. As the aircraft takes off it climbs towards it cruising altitude, say 33,000ft. Then during the cruise the airplane uses fuel meaning that the aircraft is effectively losing weight. Since during a steady cruise, lift = weight the aircraft will have an excess lift if nothing but the weight changes. This will make the aircraft climb to higher altitudes were the air is thinner and thus more lift is required.

Thus on some long-haul flights you can see that the flight ends at 38,000ft. Then the pilot initiates the decent for landing. Depending on ATC the aircraft is allowed to gradually climb during cruise to higher altitudes. If that is not allowed the aircraft will climb once every hour or so to a higher flight level.