To find the temperature it is necessary to use the expression and concepts related to the ideal gas law.
Mathematically it can be defined as
[tex]PV=nRT[/tex]
Where
P = Pressure
V = Volume
n = Number of moles
R = Gas constant
T = Temperature
When the number of moles and volume is constant then the expression can be written as
[tex]\frac{P_1}{T_1}=\frac{P_2}{T_2}[/tex]
Or in practical terms for this exercise depending on the final temperature:
[tex]T_2 = \frac{P_2T_1}{P_1}[/tex]
Our values are given as
[tex]T_1 = 400K\\P_1 = 1atm\\P_2 = 2atm[/tex]
Replacing
[tex]T_2 = \frac{(2)(400)}{1}\\T_2 = 800K[/tex]
Therefore the final temperature of the gas is 800K