"You have to eat something."
Translation:Tu dois manger quelque chose.
In your sentence (which is grammatically correct), you loose the “directivity” of the order. You can say « il faut » but then you need to make it clear you're speaking to, let's say, the person in front of you: « il faut que TU mages quelque chose ».
I'm not sure my explanation is clear... Don't hesitate to ask.
Any time (as far as I know, I'm still a beginner) a verb directly follows another verb, and often (but not always) when it's "[verb] to [verb]", you must use the infinitive.
You have to (or must) go. Tu dois aller. (Not vas.) I can speak. Je peux parler. (Not parle.) He must drink. Il doit boire. (Not boit.) He wants to swim. Il veut nager. (Not nage.) She likes to run. Elle aime courir. (Not court.)
The one exception that I do know about is "starts/begins to." Then you have to use the "à" plus the infinitive. I know there are others like this, but I can't give good examples.
He starts to run. Il commence à courir. She begins to study. Elle commence à étudier.
It has to do with the complexe verbal predicate, that means the predicate is composed of not only one verb, but of two verbs: [have to] + [eat].
In a construction with a complexe predicate, such as:
You + [have to] + [eat]
the first verb [have to] has to agree with the subject [You] regarding person (2nd) and number (singular). So [have to] is inflected: [dois].
The second verb [eat] musn't be inflected but has to be an infinitive: [manger].
The words "have to" in the sentence belong together and are a fixed expression in English meaning "must". You have to translate the meaning of the expression and not the individual words. It seems you wanted to translate "have" with "avoir" which makes no sense. (Oddly enough, if you speak what you wrote, it sounds exactly like "Nous avons mangé quelqe chose" which means "We have eaten something.")
"Avoir" is "to have" as in to possess something (mostly). "Vous avez une nouvelle voiture." You have a new car. If you want to say you have to do something, it's "devoir," which is like "must" or "to have to." "Vouz devez acheter une nouvelle voiture." You must buy a new car.
"Mangiez" is the subjunctive mood which, in this case, is identical with the imperfect. If you say "Il faut manger" you use the infinitive. However if you say "Il faut que vous….." then you have to use the subjunctive mood. Certain expressions require the subjunctive and this is one of them.
Well, technically, that means "You need to eat something," instead of "You have to eat something." In this case, the meanings are pretty similar, but there is a subtle difference. Duolingo is using "have to" as in "must," both of which are a bit stronger than "need." Despite this, I definitely understand your point. The verb "have to" is ambiguous. "Must" and "need" are less ambiguous. But in general, use devoir for "have to" because it captures the slightly stronger meaning.