When was this age for enlistment and/or the draft established? Has it ever been challenged?
Wikipedia has an article on conscription in the United States. It notes that
The Enrollment Act established the first draft, of men aged 20 to 45. This was during the Civil War, in 1863. Note that the Confederacy started a draft of men aged 18 to 35 earlier in 1862, but they weren't part of the US at that time.
In 1917, the draft covered men aged 21 to 31. With insufficient results, the age range was expanded to 18 to 45. This was the first time that 18 was used by the US government.
After Pearl Harbor, the existing peacetime draft was expanded to all men aged 18 to 64.
After the end of World War II, the modern system of Selective Service registration for all men aged 18 to 26 was started in 1948.
Richard Nixon temporarily ended mandatory Selective Service enrollment in June 1973. But Jimmy Carter resumed it in 1980. It's pretty much stayed the same since then. Never used for involuntary conscription, but always present.
I can't find any examples of people challenging the draft or Selective Service enrollment based on age. The Wikipedia article has a section on Legality which mentions challenges on several other bases. See also the legal issues section of the Selective Service System article.
The 26th amendment was passed to make 18 the national minimum voting age since the draft age was already 18. But that was political, not because the two were legally connected.