What you state is a formula for integration by substitution. The details of the proof of validity of this formula are usually left out on A-level courses. There is really no reason to be wishy-washy about this argument at all (other than for time constraints), so I thought I'd post a more rigorous answer. It goes beyond what you'll need to know for A-level, but should be understandable with a bit of work. Let me know if there's anything you want clarifying.
If $f:[a,b]\rightarrow\mathbb{R}$ is continuous, define $F(x)=\int_a^xf(u)du$ for $x \in [a,b]$. Let $g[\alpha,\beta]\rightarrow\mathbb{R}$ be continuously differentiable and such that $g(\alpha)=a,g(\beta)=b$.
We aim to show that $\int_a^bf(x)dx=\int_{\alpha}^{\beta}f(g(t))g'(t)dt$. This is seen to be the desired formula for integration by substitution with a little thought. (We can think of $g(t)$ as being the reparameterisation of $x$ and so "$g'(t)=\frac{dx}{dt}$".)
Let $h(t)=F(g(t))$. By the chain rule, $h'(t)=F'(g(t))g'(t)=f(g(t))g'(t)$. Thus:$$\int_\alpha^\beta f(g(t))g'(t)dt=\int_\alpha^\beta h'(t)dt$$
so$$\int_\alpha^\beta f(g(t))g'(t)dt=h(\beta)-h(\alpha)=F(g(\beta))-F(g(\alpha))=\int_{a}^{b}f(dx)dx$$
This argument still relies on some unproven facts, but to prove everything we need would require giving a proper definition of integration. Treating derivatives as fractions (e.g. $\frac{dx}{dt}dt=dx$) is often a good way to get an intuitive understanding of various theorems such as this and as such is frequently used to justify them, even though it isn't rigorous.