Answer
$x=2. $
Work Step by Step
$\left(\frac{1}{5}\right)^x=5^{-x}$, $\left(\frac{1}{25}\right)=\left(\frac{1}{5}\right)^2=5^{-2}$, hence the equation becomes: $5^{-x}=5^{-2}.$
The base is same on the 2 sides on the equation (and it is not $1$ or $-1 $), hence they will be equal if the exponents are equal. Hence $-x=-2\\x=2$.