Note: I'm not sure what your teacher wants you to do with the 54 m^2 rectangle because an equation below doesn't factor easily and required (for me at least) a formula you shouldn't have yet in Algebra 1. The answer is correct, but you shouldn't yet know how to get it. I assume you're talking about area (instead of perimeter) because you mention square meters (measure of area) instead of meters (measure of length, width, perimeter). The 50 m^2 rectangle (see below) works out nicer.

Length = L

Width = W

W * L = 54

W * (W + 5) = 54

W^2 + 5W = 54

W^2 + 5W - 54 = 0

Quadratic formula

If ax^2 + bx + c = 0 then x = (-b +- sqrt(b^2 - 4ac) ) / 2a

(I know you shouldn't have this yet in Algebra 1, but W^2 + 5W - 54 doesn't look like it factors nicely, so this is the only other way I know to factor it)

W = (-5 +- sqrt (25 + 216) ) / 2

W = (-5 +- sqrt(241) ) / 2

You can't have negative width, so:

W = (-5 + sqrt(241) ) / 2

W = about about 5.26

L = W + 5

L = about 10.26

.

If the rectangle inside is 2 x 2 meters smaller, that's 4 m^2 smaller, 54 - 4 = 50 m^2.

Length = L

Width = W

W * L = 50

W * (W + 5) = 50

W^2 + 5W = 50

W^2 + 5W - 50 = 0

(W - 5)(W + 10) = 0

W = 5, -10

But we can't have negative width, so:

W = 5

L = W + 5

L = 10

Answer: Width is 10, length is 5.

(much easier answer)