Oxygen is a colourless gas with no smell, so you cannot identify it by looking at it. There is a simple chemical test for oxygen that uses a glowing splint.
Light a wooden splint, let it burn for a moment, then blow out the flame so that the end is still glowing red. Put the glowing splint into a test tube of the gas. If the gas is oxygen, the splint relights.
If the gas is not oxygen, the splint does not relight. Oxygen is needed for burning, which is why the extra oxygen in the tube makes the glowing splint burst back into flame. Do not confuse this with the test for hydrogen, which uses a lit splint and gives a squeaky pop.