In the following text, is "chance" a verb or a noun?
Very few did better than chance in spotting which was which.
Could I replace it with "guess"?
This question is too basic; it can be definitively and permanently answered by a single link to a standard internet reference source designed specifically to find that type of information. See the FAQ for guidance on how to improve it.
Although the meaning is "Very few did better than they would have by random guessing", it is not possible to simply substitute the single word guess.
As noted in the comment, the single word chance is a noun but here it forms part of the structure did better than chance which is a standing for a verb such as excelled.
I assume that the expression is (as often seems to be the case when strange syntax or unfamiliar meanings are encountered) an ellipsis:
Very few did better than chance. Very few did better than [[mere]] chance [would predict].
Where even the second, expanded version is really a shortened form, of say:
Very few did better than a statistical analysis assuming random guessing on the part of the candidate would predict.
There is a very similar construction:
Very few did better than [they were] expected [to do] [by ...?]. Here, expected is a (relict?) past participle; I'm with Colin Fine when he moves towards saying that forcing a word-class on particular words in these ellipted constructions - especially a word-class referring back to a possible previous usage in a longer construction - seems counter-productive. Multi-word units (better than chance, better than expected) only really need analysing as to meaning and allowable variation (better than the examiners / his teachers / his classmates expected).