We assume the change in volume occurs at constant temperature and so we use the Boyle's law formula [tex]P_1V_1=P_2V_2[/tex].
We are given the initial volume and pressure as well as as final volume, the question wants the final pressure [tex]P_2[/tex]
So we make [tex]P_2[/tex] the subject of the formula
[tex]P_2= \frac{P_1 V_1}{V_2} = \frac{5\times10}{2.5}= 20 atm[/tex]