I'm reading that NASA plans to use a Deep Space Gateway, a space station in some kind of Lunar or Lagrange orbit, in order to send astronauts to Mars. How does such a "gateway" assist human spaceflight to Mars? Wouldn't it be easier to do assembly and tests in low Earth orbit instead? How does the Moon get involved here?
I believe every answer here is concerning itself with trying to justify it in terms of fuel and delta-v when there really is no such justification at present.
Some day when we are better established in space we will surely be mining the Moon for resources and it would make sense to have a point near the Moon to transfer these resources and use them or ship them further out.
At present our technology is not there, and we have no immediate plans to take advantage of the DSG as a fueling station or waypoint for Lunar resources.
With our current level of technology, the DSG is to serve as a shakedown/proving ground, a sort of deep space(ish) ISS to prepare for a long term voyage outside of Earth's magnetic fields and relatively benign LEO conditions. We have very little experience with long term operations beyond LEO, and the DSG provides that opportunity.
It may help to visualise the task.
Earth is at the bottom of a deep pit in space-time, the moon is further up the side of the pit, rolling around it with its own smaller pit.
To construct a spacecraft in earth-orbit, you're still more or less at the bottom of hole and have to use huge amounts of fuel to climb out of it.
The problem is that you use nearly all your fuel in that climb and have very little left when you reach the "surface".
Building a way-station at the moon or out at a lagrange point means that halfway up (or more) you'll be able to stop, replenish supplies and have more to be going on with for missions to other planets.
The big advantage of building in orbit of the moon rather than a lagrange point is the abundance of raw materials there, it's comparatively easy to get mass off the surface of the moon compared to earth, so you could potentially mine Helium3 or ice-water for fuel and create a large fuel-dump in lunar-orbit.
From the moon it's far far easier to escape the earth/moon system and reach other planets simply because you're further up the gravity-pit.
The chart below shows us something of what is going on. To get from Low Earth Orbit (LEO) to Mars transfer orbit takes 2.5+0.7+0.6 = 3.8 km/s of delta-V. Starting from Lunar orbit, it's only 1.3 km/s. What this means is that you need massively less fuel to ship a ton of anything from Lunar orbit to Mars than you do from Low Earth Orbit. So far, so good, but of course you need to get stuff to Lunar Orbit, which costs 4.1 km/s if you start from LEO and use the most obvious trajectories. So as a way to move stuff from Earth, this looks like a really bad idea. So why might you want such a Gateway? (ignoring politics).
Well, one reason is if the stuff you want to send to Mars doesn't come from Earth but from the Moon. So If you have can find ice in the craters at the Moon's poles (or somewhere else), you could ship that up to lunar orbit and pick it up to use at, or on the way tom Mars. Similarly if you bring in ice from comets or water from Ceres, you may want it close to Earth, so you can work on it, but you probably don't want to bring it all the way down to LEO. The other possibility is that you can take advantage of the interactions between the Moon's, the Sun's and Earth's gravity to get to Lunar orbit much more cheaply (if relatively slowly) as described in research paper. This might be a useful way to shift long-lived cargo from LEO up to Lunar orbit using relatively little fuel, even if it is too slow for astronauts.
Well, NASA would make a space station in the orbit of the moon to basically restock and resupply on any needed materials. But the big reason why NASA would do this is because of gravity. Since Our Moon has way less gravity, it would make a launch from there very easy on the craft itself. It would save them fuel and it would make their trip a lot more safe.