We study a calculation method for utility function from a candidate of a demand function that is not differentiable but locally Lipschitz. Using this method, we obtain two new necessary and sufficient condition for a candidate of a demand function to be a demand function. First is the symmetry and negative semi-definiteness of the Slutsky matrix, and second is the global existence of a unique concave solution for some partial differential equation. Moreover, we present under several assumptions, the upper semi-continuous weak order that corresponds to the demand function is unique, and this weak order is represented by our calculated utility function. We also provide applications of these results to econometric theory. First, we show that under several requirements, if a sequence of demand functions converges to some function with respect to a metric corresponds to the topology of compact convergence, then the limit function is also a demand function. Second, the space of demand functions that have uniform Lipschitz constant on any compact set is complete under the above metric. Third, under some additional requirement, the mapping from a demand function into a utility function we calculate becomes continuous. This implies that a consistent estimation method for the demand function immediately defines a consistent estimation method for the utility function by using our calculation method.