You are correct in your understanding that $x$ is a dummy variable.
$\int x^2\, dx$ means the set of functions $F(\cdot)$, such that $F'(t) = t^2$
If you replace $x$ with $u$ in the definition above, you can see an alternate definition
"$\int u^2\, du$ means the set of functions $F(\cdot)$, such that $F'(t) = t^2$"
Since the alternate definition specifies the same set of functions $F(\cdot)$, they are equivalent. That is to say, $\int x^2\,dx$ and $\int u^2 \,du$ denote the same set of functions.
In particular, letting $g_k : t \mapsto \frac{1}{3} t^3 + k$, they denote the set of functions $\{ g_k \}_{k \in \mathbb R}$.
Regarding your other question, the resolution is that the Stewart book was being sloppy with notation. I believe this is the part you referring to.

The key is the part that says
and so formally, without justifying our calculation, we could write
The textbook is employing "formal" reasoning, which generally means looking at the "form" or the pattern the symbols make, and manipulating those patterns, without trying to reason about the underlying meaning. There are no precise rules when you employ formal reasoning - you just do what feels right.
Formal reasoning is suitable for generating hypothesis which are later verified by an actual proof. An example of formal reasoning is the rewrite rule $\frac{dy}{dx}dx \rightarrow dy$, where a symbol looks like a fraction, so you treat it like one.
In the example from the textbook, you have $u = 1 + x^2$ and $du = 2x dx$. Since it feels right to substitute these symbols in the integral expression, that's what we do. And then it feels right to carry out the anti-differentiation as if $u$ was a variable, etc. So the equality signs in [2] are not to be taken literally, but are more saying "I hope this will turn out to be justified."