"Why?" is not a sentence, because It does not have either a subject or verb. It is acceptable only for informal usage.
The general rule in English is that a sentence may imply either a subject or a verb, but not both. As others have suggested, "Go!" can qualify as a sentence. The subject (you, the listener) is implied, but the verb, "go," is stated. So it can be a sentence. Another sentence of the same type is, "You!" which means, "You are the one." In this example the subject, "you," is stated, so the sentence only has to imply the verb, "are."
With "Why?" however, both the subject and the verb are implied. When written by itself, "why?" usually means either, "Why should I do that?" or "Why do you think that?" Those have subjects and verbs (I and do, or you and think). Since both have to be implied here, "Why?" by itself, is acceptable only in speech and in informal writing.
As a question, it can be a sentence, like: A sentence can have one word, and as a question then it can be a sentence: Who?
A "sentence" in grammar is a group of words that expresses a complete thought. Most sentences consist of at least a subject (noun form) and a predicate (verb form). The word "sentence" can also mean the punishment given for a criminal offense. Specifically, a sentence may include incarceration, or fines, or both, and may contain a period of supervised probation.
Generally one should not answer a question with a question.
You should capitalize a one-word answer to a question when that word would normally be capitalized in a sentence, such as for proper nouns or the pronoun "I." Otherwise, no additional capitalization is needed for one-word answers.
no one hears that word anymore
As a one-word answer to the question, "What are you doing?".
An example of using the word repeat in a sentence is " Can you repeat that question one more time? "
"They discussed the question enthusiastically"
I was looking for a question but I was distracted by this one.
your question could count as one
The sentence with the word 'why': Why do you ask this question?
An interrogative sentence is one that asks a question. Do you understand? That is an interrogative sentence. Comes from word interrogate, to ask.