You can purchase one for like 2$ at a HB store. Alternatevly you can make an airlock/blowoff hose from nothing more than a hose and a glass of water, providing your fermenter has a fitting for such an apparatus. Check out www.howtobrew.com
for more on airlocks and all brewing principles.
In a nutshell, an airlock is important to seal off your fermenter from the nasties in the air we breathe as well as the oxygen in the air itself.
Beer should be kept under CO2 if it is in a closed container. The airlock just uses simple principles (like pressure and gravity) to isolate your brew from the outside air, keeping it under the CO2 blanket created from yeast farts (yum).