What is the grammatical function of 'Celsius' in "ten degrees Celsius"?
They are called a "postpositive adjective".
"Celsius" is so defined in Oxford Online Dictionary:
[POSTPOSITIVE WHEN USED WITH A NUMERAL] Of or denoting a scale of temperature on which water freezes at 0° and boils at 100° under standard conditions: 'a temperature of less than 25° Celsius'
"Fahrenheit":
[POSTPOSITIVE WHEN USED WITH A NUMERAL] Of or denoting a scale of temperature on which water freezes at 32° and boils at 212° under standard conditions: 'the temperature was steady at 65° Fahrenheit'
They are put after "degrees" even though they are adjectives, which are usually placed before a noun.
Edit:
The below Ngram Viewer shows a big difference in their usages.
Second Edit:
As suggested by @Edwin Ashworth, it could also be called a post-nominal noun modifier. The linked Wikipedia article about postpositive adjective has the below explanation:
In some phrases, a noun adjunct appears postpositively (rather than in the usual prepositive position). Examples include Knights Hospitaller, Knights Templar, man Friday (or girl Friday, etc.), airman first class (also private first class, sergeant first class), as well as many names of foods and dishes, such as Bananas Foster, beef Wellington, broccoli raab, Cherries Jubilee, Chicken Tetrazzini, Crêpe Suzette, Eggs Benedict, Oysters Rockefeller, peach Melba, steak tartare, and duck a l'orange.
Note: Oxford Online Dictionary, Merriam-Webster, Collins Online Dictionary, American Heritage® Dictionary of the English Language, Fifth Edition and Random House Kernerman Webster's College Dictionary, Dictionary.com all (six dictionaries) classify the word as an adjective while Wiktionary does as a noun.
I disagree with previous responses. "Degrees celsius" is the unit, so we have a compound noun. Three rabbits, four horse radishes, five degrees celsius.