Suppose we define a function \(f\) by \(f(x) := x^2 + 2\text{.}\) Have we formally defined this function? It sounds as if this is the set of ordered pairs
\begin{equation*}
\{ \ldots , (-2, 6) , (-1, 3) , (0,2) , (1, 3) , (2 , 6) , \ldots \} .
\end{equation*}
That would be if we meant the domain to be the set of all integers. Maybe instead we meant the domain to be the set of all real numbers. In that case, the "\(\ldots\)" in the list is somewhat misleading; we should probably write the set of ordered pairs like this:
\begin{equation*}
\{ (x , x^2 + 2) : x \in \mathbb{R} \}
\end{equation*}
(we use the notation \(\mathbb{R}\) for the real numbers and \(\in\) for the "is an element of"). If this function arose in a word problem where \(f(x)\) represented the value of some quantity at a time \(x\) seconds after the start, maybe it makes sense to allow only nonnegative real numbers as inputs. Formally, this would look like
\begin{equation*}
\{ (x , x^2 + 2) : x \text{ is real and nonnegative} \},
\end{equation*}
which could also be written
\begin{equation*}
\{ (x , x^2 + 2) : x \in [0,\infty) \}
\end{equation*}
or
\begin{equation*}
\{ (x , x^2 + 2) : x \geq 0 \},
\end{equation*}
this last version assuming we understood this to mean real numbers at least zero rather than, say, integers at least zero.