How does the conductor knows which side is outside? For a electrostatic equilibrium state, we know charges only stay on the outer surface of the conductor.

But, how does the conductor know which side is outside?
If it's about the curvature, then what will happen to this shape?

If it's about the Gauss' law, then what if I poke a tiny hole in the surface? Will all the charges suddenly move to that pointy needle?

OK, so a tiny hole is not enough, what about extend the needle outside the surface? Will charges goto that needle this time?


This question can go even further (I'm not sure if I should post a new question): 
What if the surface is a Klein bottle? How is the electrostatic field looks like in four dimension? Will the conductor failed to decide which side is outside in four dimension space?
Or, is the fact that conductor can decide its side, proved that electic field is limited to three dimension?
 A: The most straightforward way to see that there is no net charge on the inside surface of the conductor in the first case is to draw an imaginary closed spherical surface inside the body of the conductor and note that (by one of the various equivalent definitions of conductor) the electric field at every point of that surface must be zero.  Thus the LHS of Gauss's Law is zero, implying the RHS (charge enclosed) must also be zero.  There is certainly no charge anywhere inside the body of the conductor (apply Gauss's Law in differential form to convince yourself of that) nor inside the vacuum region in the center.  Thus we conclude that the inside surface of the conductor must be neutral.  
But this might not be getting to the gist of your question of "how the conductor knows" which side is the outside.  I am guessing you are looking for some kind of geometrical differentiation between the inside surface and the outside surface that will justify this segregation of charge.  As to this, one can see that for any conductor that has some kind of hole on the inside, distributing charges on the inside surface will always lead to a smaller mean separation between charges than distributing them on the outside. From the point of view of a single point charge, being cramped together with other like charges is unfavourable, and the tendency is to spread out to maximal mean separation. Settling on the outside surface will achieve this.  
A: Charges of the same polarity repel each other, so they are trying to maximize the distance between them because this minimizes the coulomb energy $E_C$ that is proportional to the inverse distance $r$.
$~~~~E_C = \cfrac{1}{4 \pi \epsilon} \cfrac{e^2}{r}$
In all of your drawings the charges would gather similar to the distribution in your first picture. The small gap in the outer ring does not qualitatively change the repulsion the charges feel.
A: Charges would appear distributed in such a way that 
$E =\frac{1}{2}\int\rho(r^\prime)\Phi(r)dv  $ 
is a minimal.
But $\Phi$ is a function of $\rho$ as well 
$\Phi = \int\frac{\rho(r^\prime)}{|r-r^\prime|}dv^\prime$
So you have to minimize $E$ with respect to $\rho(r^\prime)$ subjected to the constraint of not going out of the conductor to find what will be the charge distribution on this case. 
There would be charges distributed on all surface, but its distribution would depend on this functional. 
In the symmetrical case is easy to notice that every position inside the material has a larger energy compared to when all charge is uniformly distributed over the surface, due to the $r^{-1}$ dependency on the electric potential.
In any other case, it is also possible to notice that the configuration that maximizes distances between the charges (i.e  lower the potential energy and the charge density) is the one where all of them are at the surface, any position inside of the material has a smaller distance between the charges, thus raising the potential and the charge density $\rho$.
