What does a domain of a function mean in this context? The domain* represents the set of numbers where, in essences, the function "makes sense". In calculus you generally consider functions on the real numbers, which map elements of the set of Real Numbers ($\mathbb{R}$) to other elements of the set of real numbers. There are plenty of familiar functions that map other sets of numbers. For instance the factorial function $f(x) = x!$ maps integers to other integers, $f(1.5)$ does not make sense. If we were to consider the factorial function as a function on the real numbers, we would need some way to specify that only a subset (The integers) of the real numbers are actually legal arguments for the function.
For the function you are given, observe that the denominator $x^2 - 9$ is equal to 0 at $x = \pm3$. Division by zero is not defined in this context, and therefore $f(\pm3)$ as a function on the real numbers does not make sense. We need to specify what subset of the real numbers is the function valid, that is, all real numbers except for $\pm3$ - which is exactly what the answer indicates.
The Range of the function could also be limited. In the second example, $g(x) = \sqrt[3]{2t-1}$, as you correctly observed, All real numbers are valid arguments (hence the Domain is the entire set of Real numbers) and all real numbers can come out the other end. However, consider $h(x) = \sqrt{x^2}$, the domain for this function is still all the real numbers, however, $h(x)$ is always greater than 0. Hence while all the real numbers are valid input parameters, they can only be mapped to the positive real numbers. We use the set notation to indicate the fact that the output set is limited to a subset of $\mathbb{R}$
Challenge Question
What is the domain and range of $h(f(x))$? what about $f(h(x))$?
*To clarify, the domain is part of the definition of the function and is usually specified when the function is defined. In this case though, textbook authors have overloaded the term. The functions are assumed to be defined on the real numbers, and you are asked to determine which exact subset of the real numbers constitutes the domain.