To clarify, I am asking if it's professional to ask questions that while relevant to the subject/course, and are related to the topic, but have not been discussed in class, assigned as homework, reading, etc. and are also not related to any prerequisite class that the students should already know. I am also not asking about "gotcha" questions where it's a quick "know it or not" fact, but rather an entire procedure, proof, or concept of some sort.
For example in class, using a formula from the textbook to solve problems, but on the exam asking for a proof of the formula that has been used.
Another example - in a foreign language class, asking about a never-before-seen word that may be related to some other, studied words or that has a similar sound/meaning in the native language.
Do such questions "make students think out of the box", or are they more likely to discourage students when they struggle with them? While in the real world there may be many problems similar to this where the problem is completely new, is this something that should be taught in an unrelated class?
Does it matter if the test in question will be graded on a curve where even if a student doesn't answer the question correctly at all, they could still get a good grade?
P.S. - this question was prompted by the comments in this answer