Even from a grammatical point of view, 元気 is a perfectly fine Japanese sentence.
From what I remember reading, a sentence in Japanese must either end with an adjective, a copula or a verb, if we exclude sentence ending particles and inflections.
This is more or less accurate. Here, though, we need to see that 元気 falls into the category of "ending with a copula", but with the copula itself omitted. "元気。" or "元気?" in its full version can be
- 元気だ。
- 元気です。
- 元気ですか?
- 元気です? (Yes people generally add か but grammatically it's not NECESSARY)
It just happens that だ can be omitted, and です, although not omitted because it's respectful language (omitting is considered disrespectful or casual), there is nothing grammatical that stops these copulas from being omitted.
Therefore, "元気", whether a statement or a question, is a completely grammatically correct Japanese sentence.
If you have time, I suggest reading this chapter of Tae Kim's Guide to Japanese Grammar which does explain on this topic.