We know in a quadratic x^2 +bx + c = 0, -b/a = α + β and c/a = αβ.
Therefore, α + β = -(-2k) = 2k, and αβ = k - 1. (Both are divided by the coefficient in front of x which is 1 so can be ignored.
Now (α + β)^2 = α^2 + 2αβ + β^2
Rearranging: α^2 + β^2 = (α + β)^2 - 2αβ
Substituting: 4 = (2k)^2 - 2(k - 1)
Expand: 4 = 4k^2 - 2k + 2 = 2 (2k^2 - k + 1)
Put all on one side: 0 = 2k^2 - k - 1 = (2k + 1)(k - 1)
Hence k = 1 or -1/2