If there is no gravity on the moon, how could this flag be flapping in the wind?
Ignoring the "no gravity" part of your question - there is, it's 1/6th that of the Earth, the flag looks like it's "waving" because the horizontal pole stuck part way out. This meant that the flag didn't "unfurl" fully and is hanging like a curtain rather than being stretched flat.
It was also rotated several times before Armstrong and Aldrin took the photo so any movement is due to simple inertia - (Source)
This happened on Apollo 11 and they liked the effect so much they replicated it on subsequent missions.
First of all, there is gravity on the moon; it's just weaker than the gravity on Earth.
Second, gravity has essentially nothing to do with whether a flag flaps. If you managed to create windy conditions in a zero-gravity environment, any flags placed in that wind would flap just as well as they do on Earth (or perhaps even better, since gravity wouldn't be pulling them down when the wind dies down). The reason a flag streams out behind its flagpole is just that the flag reacts to the wind, whereas the flagpole doesn't - it's closely related to the reason that an arrow or a rocket maintains its orientation during flight (the fins react to the wind more than the body or nose). And although I'm not an expert on fluid dynamics, as far as I know the actual flapping has to do with turbulence induced in the wind by the flagpole and the flag itself. None of these behaviors require gravity.
In any case, it's not even clear that the flag is flapping in that photo, because there's a rod along the top holding the flag up. But as I said in my comment, that sort of discussion is better handled on Skeptics.
Frankly I dont really have an answer for you but your question is a little off.
Moon does have a gravity its just pretty weak (abt 1/6th of earth's gravity). Due to this reason moon was unable to hold on to its atmosphere. Moon's gaseous atmosphere escaped its surface during moon's creation which means moon doesn't even have wind.
So Neil Armstong's footprints (if he really went there) would still be intact since there is no wind on moon to erode away the moon dust of the foot prints.
Absence of wind therefore makes the fluttering flag even more questionable.