If we have a function y(x), then dx/dy = 1/(dy/dx). You can "clear the fraction" in the "denominator" and see that the RHS is also dx/dy. By construction of the derivative, dx/dy would be the derivative of the inverse function.
Before someone more Mathematically minded than me comes along to remind you, let me say that treating dy/dx as a fraction is a very tricky process and is not a strictly legitimate process even where you can get away with it. (But it does occasionally provide a convenient guideline.)