Where does induced charge come from on conducting sphere?

Suppose we have a neutral conducting sphere and we bring a charge $q$ near it. There is an induced charge on the conducting sphere (the integral of the surface charge density is nonzero).

But where does this charge come from? How is this possible if all the charge must be on the surface (since it's a conductor) but the net surface charge is originally zero.

• If the sphere was neutral and not connected to for example earth, then it remains neutral. – my2cts Jun 12 '18 at 19:51

When the neutral conducting sphere is isolated, the induced net surface charge on the sphere near the charge $q$ will have the opposite sign as the net surface charge on the far end of the sphere so that the total surface charge on the sphere remains zero. The induction only leads to a separation of positive and negative charges. When the sphere is grounded, there will be a net surface charge induced on the sphere which comes from the ground where an exactly opposite charge will be left behind. Also here only a separation of charges occurs.
• @JoshuaBenabou - The link refers to the situation of the image charge method for the case of a point charge $q$ put inside a conductive sphere which provides the calculation of the potential and field inside, not outside the sphere. In such a case, according to Gauss's law, the total surface charge on the outside of an isolated sphere will always be equal to the point charge inside the sphere. You can, however, use the method of images charge also in the case of a charge $q$ outside the sphere. See my answer here: physics.stackexchange.com/a/410926/129209 – freecharly Jun 13 '18 at 15:32