Avagadros law states that the volume of a gas is directly proportional to the number of moles at constant temperature and pressure conditions

= k
where V - volume
n - number of moles and k - constant

parameters for the first instance are on the left side and parameters for the second instance are on the right side of the equation
V1 - 4.50 L
V2 - 1/2 x 4.50 = 2.25 L
n1 - 2.00 mol
substituting the values in the equation

n = 1.00 mol
1.00 mol of the gas is present when container is 1/2 in size