It would be more appropriate to say "to have an apple." Avoir is the infinitive; it means "to have."
I thought to say "Have an apple" is using the imperative, so this should be said as "Avez une pomme" in French. Why is "Avoir une pomme" even allowed?
Given the content of this statement, it seems like you shouldn't use the infinitive to give the command. "have an apple" is a personal statement to a known audience.
I've been living in France for 8 months and really, the sentences here in DL are not common, not so useful to learn french but to practice gramar and writing.
No, you would not. If you check out the link that I posted above, you'll read that "The infinitive is used for impersonal commands to an unknown audience, as in warnings, instruction manuals, and recipes. It is used in place of the vous form of the imperative."