Let the side of square be s and the length and breadth or width of the rectangle be l and b respectively. (Also, keep in mind that when I am using the * symbol, it stands for multiplication)
s = b + 1
l = 2b - 1
Perimeter of rectangle = 2(l+b) = 2(2b-1+b) = 2(3b-1) = 6b - 2
Perimeter of square = 4(b+1) = 4b + 4
6b - 2 = 4b + 4
6b - 4b = 4 + 2
2b = 6
b = 6/2 = 3 cm
l = (3*2) - 1 = 6 - 1 = 5 cm
Hope I helped! If so, please feel free to rate my answer and consider giving it the Brainliest.