The triangle inside the square creates an isosceles triangle, with two equal angles of 45° and an angle of 90°.
Let x = the side length of the square.
Apply the Pythagorean theorem to the right triangle.
x² = 3³ + 3² = 18
x = √(18) = 4.243 units
C. 4.2 units