Translation:Is it necessary to buy it?
I disagree with the English translation because it does not convey for whom it might be necessary. I believe it should be "is it necessary for me to buy it" or much more naturally "do I have to/should I/must I buy it?".
Your reasoning is correct.
"Is it necessary that i buy it?" is also accepted.
buy him ? who is him ? a human ?
"îl" can mean "it" or "him". In this case, it's more likely to mean "it" (depending on the context, of course: it could be a sentence used in a place or time where slavery exists).