We introduce the N-body simulation technique to follow structure formation in linear and nonlinear regimes for the extended quintessence models (scalar-tensor theories in which the scalar field has a self-interaction potential and behaves as dark energy), and apply it to a class of models specified by an inverse power-law potential and a non-minimal coupling. Our full solution of the scalar field perturbation confirms that, when the potential is not too nonlinear, the effects of the scalar field could be accurately approximated as a modification of background expansion rate plus a rescaling of the effective gravitational constant relevant for structure growth. For the models we consider, these have opposite effects, leading to a weak net effect in the linear perturbation regime. However, on the nonlinear scales the modified expansion rate dominates and could produce interesting signatures in the matter power spectrum and mass function, which might be used to improve the constraints on the models from cosmological data. We show that the density profiles of the dark matter halos are well described by the Navarro-Frenk-White formula, although the scalar field could change the concentration. We also derive an analytic formula for the scalar field perturbation inside halos assuming NFW density profile and sphericity, which agrees well with numerical results if the parameter is appropriately tuned. The results suggest that for the models considered, the spatial variation of the scalar field (and thus the locally measured gravitational constant) is very weak, and so local experiments could see the background variation of gravitational constant.