Is the following argument valid?

1. |x| = {x, if x>0; -x, if x<0}; True statement

2. We check both cases:

For x>0, |x|^2= (|x|)^2 = (x)^2 = x^2

For x<0, |x|^2= (|x|)^2 = (-x)^2 = [(-1)^2][(x)^2] = x^2

Thus,|x|^2 and x^2 are interchangeable expressions.