The laws of physics still apply in space. The path of the bullet should be fairly straight, as gravity is greatly reduced though not entirely absent. There may be a reduced air supply on a spaceship, and there would certainly be one outside it, so the bullet would encounter less friction and would probably continue on its path longer. Newton's third law, that there is an equal reaction for every action, means there would still be a recoil from the explosive expellation of the bullet. Gunpowder contains its own oxidizing agent, saltpeter, formally known as potassium nitrate, or KNO3.
Some problems present themselves for the shooter.
And there is the question of how the gun would get up there in the first place. With today's rocket technology, cargo weight must be carefully controlled on space flights, and the added weight of an unauthorized firearm would probably be detected before the launching. New questions are answered on the site every Tuesday and Thursday.