The graph of an inverse function is the original reflected across the line y=x, and reflecting a point across that line swaps its coordinates.
(2, 25) ⟶ (25, 2)
Check it directly against the definition: 52=25, so the exponent that turns 5 into 25 is 2, which says log525=2.