Was baptism for the dead part of the Law of Moses or did Christ initiate it during his ministry?
No, it was not a part of the Law of Moses. No vicarious work for the dead was performed prior to the Atonement of Christ. Consider the following passages of scripture to help with the background.
For for this cause was the gospel preached also to them that are dead, that they might be judged according to men in the flesh, but live according to God in the spirit. (1 Peter 4:6)
This doesn’t give background on who did the teaching or when it happened. For that information, we look to the Doctrine and Covenants
(regarding Christ’s ministry)…
27 But his ministry among those who were dead was limited to the brief time intervening between the crucifixion and his resurrection;
28 And I wondered at the words of Peter—wherein he said that the Son of God preached unto the spirits in prison, who sometime were disobedient, when once the long-suffering of God waited in the days of Noah—and how it was possible for him to preach to those spirits and perform the necessary labor among them in so short a time.
29 And as I wondered, my eyes were opened, and my understanding quickened, and I perceived that the Lord went not in person among the wicked and the disobedient who had rejected the truth, to teach them;
30 But behold, from among the righteous, he organized his forces and appointed messengers, clothed with power and authority, and commissioned them to go forth and carry the light of the gospel to them that were in darkness, even to all the spirits of men; and thus was the gospel preached to the dead.
31 And the chosen messengers went forth to declare the acceptable day of the Lord and proclaim liberty to the captives who were bound, even unto all who would repent of their sins and receive the gospel.
32 Thus was the gospel preached to those who had died in their sins, without a knowledge of the truth, or in transgression, having rejected the prophets.
33 These were taught faith in God, repentance from sin, vicarious baptism for the remission of sins, the gift of the Holy Ghost by the laying on of hands,
So, we see that it was during that period between death and resurrection that the Savior initiated the process that would allow the freedom from Spirit Prison to be realized.