A method to treat a sharp discontinuity by the density function is proposed. The surface of the density function is described by one grid throughout the calculation even when the surface is largely distorted. This description is made possible by the CIP method combined with variable transformation. This scheme can be used for detecting sharp boundary of compressible fluid as well as incompressible fluid. Lower order schemes with the same procedure cannot reproduce the result. This scheme is applied to the injection of heavier fluid into lighter fluid and the roll-up of mushroom structure is successfully treated by the density function. The interaction of a shock wave with a liquid drop is an interesting but quite difficult test problem. Even in this case, the liquid mass is conserved within an error of 0.15%.