Elrond chooses nine representatives of the Free Peoples of the World to go against the Nine Ringwraiths, or are slaves in every meaning of the word--and even worse than slaves, because they are still slaves in Death.
You should know why the ones who volunteered went. Frodo, Merry, Pippin and Sam are easy--Frodo HAS to go, and the other three hobbits are great friends of his and would not let him go alone.
Gandalf is a friend of Hobbits and takes it upon himself to watch over them.
Boromir: He is on a quest from his land to search for help--and he is to go on this quest until a certain point, and then return to his land with help.
Legolas: He is a prince and a representative of his kind. Due to his fighting skills, he goes.
Aragorn: He has been with the Hobbits for a long time by this point, and he has saved them. He knows the extreme importance of this mission and since he is actually a king, he will do all he can to save his lands.