DNA testing could in principle tell you if you were going bald if all of the genes for baldness were well identified and if specific DNA tests for those genes were identified. However, this technology does not currently exist.
Generally speaking, DNA testing should be reserved for helping to diagnose a suspected inherited or genetic medical disorder. Therefore, it is not commonly done except in consultation with a medical genetics specialist when thinking about unusual symptoms or problems that suggest an underlying inherited condition. It should not be routinely done in an otherwise healthy young male.
The other situation in which DNA testing may be used is in the setting of wanting to have a child if there is a strong family history of a genetic condition. Testing the parents can help determine the risk that their child will have a genetic condition. Also, if a member of the family has recently been diagnosed with a genetic disorder, DNA testing of members of the family may be recommended to determine if they also have the disorder or are at risk of developing the disorder later in life.
In the absence of these indications, DNA testing would be discouraged. Talk to your
primary care doctor if you have more questions.