I'm supposed to somehow use the linear transformation $BA + B - I$, where $B$ is a right inverse for $A$. It can't be the inverse, since $BA$ is the inverse..
I can do it fairly easily by using the fact that for a linear transformation, injectivity and surjectivity always occur together, and then using the fact that bijectivity implies invertibility. But I'd like to know how to do it in this way..
Edit : Sorry, the problem statement doesn't say anything about it being finite dimensional. I guess it's because we haven't done anything infinite dimensional, so it's kinda assumed.
Suppose $B$ is a right inverse for $A$ i.e. $AB = I$. Then, note that : $$A(BA + B - I) = ABA + AB - A = AB = I$$. But right inverses are unique (why?), therefore $BA+B-I = B$, simplifying to $BA =I$, therefore $B$ is also the left inverse of $A$, therefore $A$ is invertible and $A^{-1} = B$.
Let $XY = I$ and $XZ = I$. Then, $X(Y-Z) =0$, but $X$ is right invertible, therefore surjective, which in finite dimensions implies that it is injective(rank nullity) and therefore $Y-Z = 0$. Note that if it is not finite dimensional, then we can only conclude that it is surjective, and in that case the statement is actually false.