What is the use of filters in humidifier?

First, let's refer to the air filter. The filter in the humidifier is actually a form of wick. It brings the water up from the reservoir in passes in front of the air flow. The air picks up the moisture from the filter and carries it in to the atmosphere (your home). This increases the humidity of the air in your home.

If you're referring to an older standalone unit, they usually have a drum filter that rotates through the water. The newer models vaporize the water and force it in the air. Some models have a filter to trap impurities that may be included in the water vapor.

Furnace type humidifiers are of two types. One with a drum that works the same way as the standalone drum type described above. The difference being that the furnace moves the air over the drum. The second type of furnace humidifier does not use a drum and reservoir. Instead, the water from the feed hose is trickled over the filter. The air again blows from the furnace over the filter to pick up the moisture.

Humidifiers often have water filters too. This is to remove impurities from the water before it actually enters the humidifier. This helps extend the life of the unit itself and helps to prevent the delivery of these impurities into the air.