Does the temperature during this reaction remain constant? Considering all gases to be ideal, the enthapy change for the reaction
$$\ce{I2 (g) + H2 (g) -&gt; 2 HI (g)}$$
is $\pu{−106.78 kJ}$ at $\pu{350 K}$. 
To find the change in internal energy the formula we use is 
$$\Delta H = \Delta U + (\Delta n)RT \, .$$

To derive this equation we must have assumed the temperature during the reaction to be constant in the expression 
$$\Delta H = \Delta U + \Delta(nRT).$$ 
I know that $\Delta U$ depends on temperature and the amount of substance, but if we assumed the temperature to be constant then $\Delta U$ should be $0$,
as the amount of substances of reactants and products are also the same, but it has a non-zero value. Is this possible?
The internal energy of an ideal gas mixture is determined not only by the temperature, but also by the chemical composition of the mixture, and, in the case of a chemical reaction, the composition changes.  For a real gas, the internal energy also becomes pressure-dependent at higher pressures.