He has to do it. Hasn't he (to)?
Is the 'to' correct/ incorrect/ unnecessary?
Is that a case of an infinitive in interrogative tail (question tag)?
Have to is an idiom, a paraphrase of the modal auxiliary verb must; it's always pronounced /'hæftə/ (/'hæstə/ in 3SgPres -- always /f/ instead of /v/ and /s/ instead of /z/), and it can't be split up.
Modal paraphrase idioms like hafta, wanna, gotta, etc. are written with to in formal spelling, but that's just a marker for the infinitive that has to follow hasta, and it also has to be all in one unit. You can't say, for instance,
because it splits up had and to. You can't even contract a negative with it
is ungrammatical, while
with Do-Support, is grammatical.
That's why it doesn't form a normal tag question; the tag requires a contracted negative, and that's ungrammatical. Instead, as Rory, Kris, and Noah all suggest, using do/does/did of Do-Support is the correct solution.
In this instance you would not need that final 'to' - it would be far too cumbersome.
Or even better:
as that final part translates as... doesn't he have to?
In OP's specific context, "has" would normally be pronounced "hass", as per this earlier question.
To my ear, "He hass to do it" followed by ", hasn't he?" is "disjunctive", because the first instance of the word is both vocally stressed and pronounced differently to the shortened second occurrence.
In light of the above, I might be tempted to recast OP's version to "He has to do it, has he not?". But in reality, I'd probably say "He has to do it, doesn't he?" - or more likely, I just wouldn't append that slightly awkward question tag anyway. But in no circumstances would I (or any other native speaker, I suspect) echo the word "to" in the tag.