I was using integration by substitution to solve this fairly simple indefinite integral:
$$\int xe^{x^2}~dx$$
I simply made the substitution $$x^2=t$$ $$dt=2x~dx$$ But it occurred to me that I don't actually understand how this is possible, because the substitution I made is not injective! In this case the integral is indefinite, but what if I were trying to integrate over some interval? Couldn't a non-injective substitution destroy important information - for example, eliminating signs if I square a variable - or something like that, thus giving the wrong answer?