Heating organic compound in a stream of nitrogen gas This is related to estimation of percentage of oxygen in an organic compound and my textbook states:


  A definite mass of an organic compound is decomposed by heating in a stream of nitrogen gas.


I would like to ask will all oxygen present in the compound evolve as molecular oxygen? Isn't there any possibility that carbon and oxygen of organic compound combine and form CO2 thereby producing error in measurement?
This is a strangely written text. In a practical setting, the way to get oxygen concentration is by sending an organic sample to a lab for an ultimate analysis.  The ultimate analysis chemistry is explained elsewhere.  

The highlighted text seems to describe anoxic pyrolysis of organic matter well above 450°C (for coals this temperature may be higher).  Pyrolysis proceeds as follows.

$$\ce{Organics -&gt;[heat]  syngas + tar + char  }$$

If any molecular oxygen were present in the system these two reactions would very quickly happen.
$$\ce{Organics + O_2 -&gt;[heat]  2CO }$$
$$\ce{2H^+ + O_2 -&gt;[heat]  H_2O }$$

The syngas contains elemental oxygen mostly in the form of $CO$ and $H_2O$, however, other gasses like $CO_2$, $H_2S$, and perhaps even other hydrocarbons may be present.  For the sygas to have most of the elemental oxygen as opposed to the char or tar phase high temperatures exceeding 450°C is important.   

If the syngas containing the volatilized matter is passed over a bed of hot coal around 900°C then several things happen.


Complex particles break down (hence the lysis in pyrolysis.)
The gas stream picks up elemental carbon from the bed of hot coal.
$$\ce{CO_2 + C -&gt;[heat]  2CO}$$
$$\ce{H_2O + C -&gt;[heat]  H_2 + CO}$$


By this point, if the temperature is hot enough, all but perhaps an insignificant fraction of the elemental oxygen will convert into $CO$.         

Testing for $CO$ is done with the iodine pentoxide test.