'Him or herself' v. 'himself or herself'?
Solution 1:
As others have suggested, himself or herself or him- or herself are possible and acceptable; I feel that him or herself is also fine, and perhaps even better.
Although, indeed, him(-) or herself looks like illegitimately cutting up a word, this is how I think most people would say it in speech. Speech is normally leading in such cases, unless this gives you clearly unacceptable results.
As to the hyphen, English normally only uses hyphens where they are necessary to avoid ambiguity, as in compound adjectives. This means that many style books will recommend that you hyphenate an ill-advised proposal, but not this proposal is ill advised, since the latter is not at all ambiguous.
However, some style books will choose to hyphenate even is ill advised, for the sake of consistency; there is something to be said for that. But in general, hyphenation is not extremely strict, and it often comes down to common sense. (Notice the contrast with other European languages, such as Dutch, where the hyphen would be mandatory in hem- of haarzelf and with all noun adjectives, such as noun adjective. I believe the same applies to German. I don't think this construction is even possible in French.)
In the case of two compound words where part of the first one is omitted in ellipsis, as in him(-) or herself, I would only add the hyphen if it were required to avoid ambiguity, which is not the case in this example. Hyphens slightly disrupt the flow of reading. I believe Fowler agrees with me here in his Modern English Usage. So I would simply write it as the New York Times does:
No student, of any background, should be expected at the outset to recognize him or herself in it.
You could also use themselves and change the subject to students, use themselves with a singular antecedent, or use only himself—but let's not rake up that discussion.