The substitution rule and differentials The following is from Stewart's 'single variable calculus, 6E' (the bold is mine)   
$$\int f(g(x))g'(x)dx = \int f(u)du$$
"Notice that the Substitution Rule for integration was proved using the chain rule for differentiation. Notice also that if $u=g(x)$, then $du = g'(x)dx$, so a way to remember the Substitution Rule is to think of $dx$ and $du$ in (4) [the above equaion] as differentials."
I understand the proof that the textbook provides for the substitution rule, but it doesn't say anything about differentials. I also see that if you make the substitutions mentioned, then you have the exact same notation on both sides of the equation, but saying that $du$ can be treated as a differential seems not justified. Therefore, its not clear to me how we can say that $du = g'(x)dx$.
 A: Prologue
Stewart is shorting you on the whole story. I'm going to attempt to broaden your horizons so that you can see a few flowers, pick them, and proceed on your merry way.
Leibniz
Back in the olden days, Leibniz considered the derivative of a function $y=f(x)$ to be the change of $y$ with respect to $x$. We get a feeling that the phrase 'with respect to' is being used much like the phrase 'in ratio to' since Leibniz would denote such a derivative with the following scribbles: $\dfrac{dy}{dx}$. Clearly, though, Leibniz considered $dy$ and $dx$ to entire quantities. By 'entire quantities', I mean that he did not think that there was multiplication occurring. That is, $dy$ is not $d$ multiplied by $y$ and $dx$ is not $d$ multiplied by $x$. Hence, we don't have that $\dfrac{dy}{dx}=\dfrac{y}{x}$ in this context because $dy$ and $dx$ are entire quantities. As you can see, this 'fraction' $\dfrac{dy}{dx}$ is already funky...
People weren't happy with the things that Leibniz was sweeping under a rug. Most importantly, he never formalized what those scribbles $dy$ and $dx$ even meant. He just said---I am oversimplifying a bit here---that those were 'infinitesimals'. People didn't like that, especially Cauchy.
Cauchy
Cauchy, being the guy that he is, decided he was going to set things straight. Cauchy said, "Let there be differentials $dy=f'(x)dx$ where $f'(x)$ is the derivative of $f(x)$ with respect to $x$, and $dy$ and $dx$ are simply new variables taking finite real values." The people saw that there were differentials. And it was good.
Now, why was it so good? Well, it was good because it really got rid of the notion of infinitesimals. Cauchy wasn't concerned with what $dy$ and $dx$ were, precisely. He was concerned with what $f'(x)$ was, the derivative. Unlike Leibniz, Cauchy defined the derivative as a limit of difference quotients and let the expressions $dy$ and $dx$ be defined in $dy=f'(x)dx$ as two variables which are real numbers. Hooray! No more infinitesimals.
What Stewart is Doing
I would assume that Stewart is operating in the domain Cauchy provides and not the domain Leibniz provides (though Leibniz really doesn't provide a good domain to begin with, as pointed out by Cauchy and others). So, Stewart is saying that a differential is some real variable defined by an equation of the form $dy=f'(x)dx$ where $dy$ and $dx$ are both real numbers. That's what a differential is in Stewart's context.
So, how do we arrive at the notion $du=g'(x)dx$? Purely by definition!

Epilogue
And here are the other flowers you missed: (1), (2), . . . :-)
A: This is kind of a short answer, but if $u=g(x)$, then $\frac{du}{dx}=g'(x)$ and so $du = g'(x)\ dx$. Remember that this is just convenient notation to help us remember the substitution rule; in this context, the differentials don't actually have any meaning.
