Is 'they would like some fruit' or 'a fruit' correct?

Short and sweet answer :

Both are correct but the first version is far more commonly heard.

Slightly longer but correspondingly sweeter:

At least in American English, you would never hear "He would like a fruit," but only "...some fruit" or "...a piece of fruit". The only time you would ever hear the phrase "a fruit" is to mean a type of fruit, not an instance of fruit (except in slang meaning 'homosexual' or 'crazy'). So it would be correct to say, "At Camp HappyBrat we serve 3 healthy meals a day. The dinner consists of a main course of meat, chicken, or fish, two vegetables, and a fruit, plus dessert."

Also, just "fruit" can be used, in which case it means an unspecified type and amount: "Don't let Johnny have any junk food. If he's hungry, give him fruit."

This can only be answered if the sentence is taken apart: "They would like some fruit."

The problem with this is that it is not correct in itself. They is a plural pronoun, it refers to a group of two or more people who in context should either be known to the speaker (and one can assume the audience) or have been referred to previously (which in practice makes them known). As a stand alone sentence, it would be incorrect to use they in any other way. The identity of the subject must be either known or implied.

The verb phrase would like is a bit easier and requires no explanation or tampering.

Some is an adjective indicating an unspecified number. The problem of vagueness should be more evident now. If the type of fruit is known or previously implied, much like with they, then the use of some is acceptable. If the type of fruit has neither been identified nor implied then the use of some should be avoided. Together with fruit, when that fruit is not identified, the sentence becomes more vague and potentially confusing.

Now, with the sentence, They would like a fruit, meaning becomes more confused in a practical way. Are they going to share an apple, a peach, a kumquat, a grape? This is gibberish. If the subject is identified, and the group could logistically share a single piece of fruit, perhaps then it could make sense; otherwise, no, it makes no sense.

There are those who will argue that the use of they is acceptable when the subject is unknown, singular or plural. This is incorrect. From a grammatical standpoint, the only acceptable pronoun in such situations is the singular "he" in singular situations, unless the gender of the subject is known, in which case the speaker obviously would use "she" for a female. In groups of two or more, it is correct to identify individuals: "The two boys," "The girl and boy," or "The three thousand people." (That last should help to explain further the confusion of the "a fruit" question).

In a nutshell, specificity is the key. When speaking about someone, use a name, gender, or description. When speaking about an item (such as fruit), name it or describe it.

Language is about communication. People often take this for granted and fail to communicate effectively. Those who are most guilty of this use short hand or code-speak, and expect the rest of humanity to understand. Consider this, when your audience does not understand what you are trying to communicate, the vast majority of the time it is the fault of the speaker, you. Your responsibility then is to fix the problem, and communicate effectively.