Yes, theoperaghost, a bullet would indeed fire on the moon for the reason explained by Neobican.
But shooting on the moon would be a very, very different experience than shooting on Earth. You know that ‘kick’ you feel when you fire a gun? It’s the embodiment of Newton’s 3rd law of the conservation of energy: “For every action, there is an equal, yet opposite, reaction.”
On the earth, the force of the gun’s recoil pushes you back with the same force with which the bullet is propelled forward (the reason you only feel a small kick, though, is because the force that propels the 20 gram bullet forward with enough energy to kill is acting backward against your mass of maybe 80 kilograms – or 4,000 times more mass). On Earth, the force of gravity is more than sufficient to keep your feet firmly planted against the recoil.
But it’s a different story on the moon. With only about 1/6 of Earth’s gravity, the kick of the recoil would likely be enough to overcome the paltry force of the moon’s gravity acting on you. The result: you’d go flying backwards. The only way to safely shoot on the moon would be either in a prone position (in which case you’d still be thrown backwards, though with less drastic results because you’re already on the ground), or firmly braced against an immovable object.
Shooting at someone in free space would be a suicide mission. Newton’s laws still apply (and are, in fact, made all the more evident without the domineering power of Earth’s gravity). The bullet would indeed go forward, and you would go back, and back, and back …
(As a complete aside, Newton’s laws are so obvious outside a strong gravitational force that skews everything that it’s been said that had humankind evolved in a place with low gravity, we would have come up with the laws of motion before we came up with the wheel.)
As to your second question, shooting a gun under water isn’t much different than shooting on land.
No more than the air in the barrel would block a bullet; the bullet has to travel through the medium of water just as it has to travel through the medium of air, pushing either medium aside as it goes. But water is thousands of times more dense than air, so the bullet would travel much slower and be stopped much sooner. Of course, if you went very, very deep into the ocean, I suppose you might get to a depth where the pressure of the water is so great that it would be easier for the barrel to explode than it would be to expel the bullet into that great pressure (of course, by that pressure, the gun – not to mention you – would probably be crushed, so it’s a moot point anyway).
Finally on this topic, my above explanations of underwater firing assume the water has not breached the bullet’s casing and soaked the powder, in which case the bullet wouldn’t fire.
On an entirely unrelated topic, I have to respond to Neobican’s comment:
Please do not confuse a ‘burning’ star with combustion as it happens on Earth. The process that makes a star glow has nothing whatsoever to do with combustion. Instead, it is the process of fusing the atoms of two elements together to produce a new element. In the case of a young star such as ours, it’s two hydrogen atoms fusing into one helium atom – a process that has nothing to do with combustion and takes place without the presence of oxygen.
~ Complacency is far more dangerous than outrage