Proving two matrices are equal A friend and I are having some trouble with a linear algebra problem:
Let $A$ and $B$ be square matrices with dimensions $n\times n$
Prove or disprove:
If $A^2=B^2$ then $A=B$ or $A=-B$
It seems to be true but the rest of my class insists it's false - I can't find an example where this isn't the case - can someone shed some light on this?
Thanks!

Your class is correct, and consider the suggestion in the comment:
Let 
$$A=\left(\begin{array}{rr}1 & 0\\ 0 & 1\end{array}\right), \ \mathrm{and} \ B=\left(\begin{array}{rr}-1 & 0\\ 0 & 1\end{array}\right).$$
