For what values a and b is the complex number z = a + bi a solution to z=z^2 ?

I tried this in many different ways and il post one of my solutions but i dont know if its correct.

(a+bi) = (a+bi)^2

dividing by a+bi on both sides.

1 = a + bi

This tells me that Z is real and that a = 1 and b = 0.

Is this correct?