Mosquitos are food for many other organisms.
Yes? That doesn't mean there's any necessity involved.
(Unless you are fond of teleological reasoning.)
Well by that logic nothing is necessary.
(Unless you are fond of teleological reasoning.)
Necessary in what sense? It's a bit like saying mosquitoes were necessary to create.
They continue to exist because they are good at perpetuating their own existence.