On the one hand, the assumptions are an indispensable part of any theorem and many mistakes (well beyond the student homework) have been made exactly because somebody didn't understand that the conclusion of a certain result holds only under certain conditions which might be well-hidden in the sentences "assuming that $f$, $g$ are as in Lemma 5". So remembering formulae without clear understanding what classes of functions they can be applied to is not enough.
On the other hand, a lot of times we start teaching results in simple situations that are very far from full generality in which they really hold, so it is important to emphasize that some conditions are imposed just because of the students' limited knowledge, not because they are really needed.
The best practice is to bite a bit from both ends, i.e., to state and prove the theorem under assumptions that are easy to understand and check, but to show some really pathological counterexamples too so that the students would know that without assuming anything at all things can go awry.
If it were a decent analysis course, I would phrase your particular test question as follows.
Assuming that $f$ and $g$ are defined on the entire real line, $g$ is non-decreasing, and $a,b\in\mathbb R$, the change of variable formula
$$
\int_a^b f(g(x))g'(x)dx=\int_{g(a)}^{g(b)} f(y)dy
$$
holds for the Riemann integral
A) For arbitrary locally Riemann integrable $f$ and differentiable $g$
B) For arbitrary continuous $f$ and continuously differentiable $g$
C) For arbitrary locally Riemann integrable $f$ and differentiable $g$ with locally Riemann integrable derivative.
D) For arbitrary locally Riemann integrable $f$ and continuously differentiable $g$
Choose the most general option that is correct.
In calculus you, probably, do not want to go that far, but you can make a similar list with options that are more obviously true or false.