Educated at the Edinburgh Academy, Mair studied classics at the University of Edinburgh, where he graduated with honours in 1946. His studies were interrupted by World War II, during which he served as an instructor with the East Lancashire Regiment. After this, he returned to teach at the Edinburgh Academy, before taking up the position of rector at Kelvinside in 1958, a post he held until 1980. During his tenure he greatly improved the Academy's performance, in the academic field as well as in sports. After his retirement he worked as a chairman of The Frank Buttle Trust, a charity for deprived children.
Mair was married twice, first to Catherine Finlay and later to Susanne Clark. He had a son and a daughter from his first marriage; his son Colin was rector of The High School of Glasgow and his daughter, Anne, was headmistress of Kelvinside Academy Junior School.