In recent days, two very large companies have decided to require that gun buyers be at least 21 years of age [Reuters]. I understand that the government can add age restrictions to sale of certain items. However, can an individual company elect to do so if it is not legally required? Doesn't that amount to age discrimination?
Discrimination is legal, so long as there is not based on a protected category or class(e.g. race, sex, religion).
Age is generally not a protected category. Some states do treat age as a protected category, but:
1) It is generally only in employment, so, for example charging someone differing amounts based on their age is legal (e.g. senior discounts, kids under X are free, etc.).
2) It is generally only protecting higher ages (i.e. discriminating against someone in employment because their age is higher than what you'd like would be illegal, but discriminating against someone because their age is lower than you'd like is not; and in some cases the later is mandatory).