The right side contains log5(−x), which exists only when −x>0, that is when x<0. So no positive x can work, and x=0 fails on both sides.
For x<0 the number −x is positive, and (−x)2=x2, so the power rule applies to −x and gives equality.
2log5(−x)=log5((−x)2)=log5(x2)
Check at x=−5: the left side is log525=2, and the right side is 2log55=2. This is the mirror image of the familiar rule log5(x2)=2log5x, which holds exactly when x>0. Both are special cases of log5(x2)=2log5∣x∣.