An air filter is a device which is placed on the intake side of the carburetor and prevents foreign material from getting sucked into the carburetor. Generally, the air filter is there to prevent things like road grit, dust, mud, water, and other nastiness from getting into your carburetor. Foreign material which is sucked into the carburetor will most likely end up in the cylinder -- the cylinder is the LAST place you want things like sand or tiny bits of rock, as they will score the cylinder and piston, rendering them less effective and more prone to seizure.
Air Filter Materials
Traditionally, these have taken the form of metal screens, but more recently, foam and paper have been used. One inexpensive material that can be used for a very basic air filter is a few layers of pantyhose.
Air Filters, Mixture and Performance
Air filters also serve an auxiliary function with regards to mixture. A more restrictive air filter can make the engine run richer than it would with a less restrictive air filter. However, this is not the end of what air filters can do. Many piston-ported cylinders (cylinders without reed valves) deliver a pulse of mixture backwards out of the carburetor during part of the stroke. Without an air filter, this pulse is completely lost. However, an air filter can help to 'catch' this fuel and suspend it in the filter medium (as well as contain it within the air filter housing, if it exists) until the intake part of the stroke when the engine will suck it back in. This function of the air filter improves both performance and fuel efficiency.
Generally, air filters which restrict the flow the least are best for performance. However, higher flow filters don't necessarily filter less, and this is important to take into consideration when deciding upon an air filter setup. When installing a new air filter, one should note the change in flow characteristics, and re-jet accordingly. Check your jetting by doing plug chops.