"How did they get their assigned functions ?"
We cannot know. They have, as far as we know, always had them.
If they have always been, and they have assigned duties and there is no overlap then you have just described something that is one. Your 42 God's work as one, and seeing that they do not overlap you have described what is in essence One God comprised of 42 sub gods.
So, your best guess leads to the conclusion that there can only logically be one God, not many.
Do you care to back track and chose another answer you made along the way ? (hint=logic will bring you back to one God answer if there is in fact a God. Other conclusions result in absurdities)