The method of separation of variables is nothing more than an application of the chain rule, so you can avoid the symbols $dx$ and $dy$ altogether:
If $\frac{\mathrm{d} y}{\mathrm{d} x}=\frac{f(x)}{g(y)}$, then
$\frac{\mathrm{d} y}{\mathrm{d} x}g(y)=f(x)$.
If $g$ has an antiderivative, $G$ then $\frac{\mathrm{d} G}{\mathrm{d} y}=g(y)$ and we get
$\frac{\mathrm{d} y}{\mathrm{d} x}\frac{\mathrm{d} G}{\mathrm{d} y}=f(x)$.
The LHS is $(G\circ y)'(x)$ from which it follows that
$(G\circ y)(x)=\int f(x)dx.\ $ (Note the antiderivative is taken wrt $x$ on $both$ sides).
On the other hand, $(G\circ y)(x)=G(y(x))=G(y)=\int g(y)dy$.
Putting this all together, we have the desired result
$\int g(y)dy=\int f(x)dx.$
Remark: I guess to treat $dx$ and $dy$ rigorously, it is best to regard them as linear functions on tangent spaces.