Heisenberg's uncertainty principle derivation in a ring The standard derivation
But now suppose the space is a ring of length $L$, it seems the derivation could work out exactly the same and we get $$\Delta p \Delta x \geq \hbar/2.$$
But since $\Delta x$ is limited, and if we choose an eigenstate of momentun, we can actually achieve $$\Delta p \Delta x = 0.$$
What's wrong here?
 A: The point is that the domain $D(P)$ of $P$ must be such that $P$ is (essentially) self-adjoint thereon. Otherwise it does not represent an observable. I am assuming that $D(X)= L^2([0,L],dx)$ instead, where $X$ is automatically self-adjoint. 
The vector $\psi$ you use to prove Heisenberg inequality has to belong to $D(PX) \cap D(XP)$ as you see by direct inspection proving the wanted inequality.
In $L^2(\mathbb R, dx)$ we have
$D(P)\cap D(X) \supset {\cal S}(\mathbb R)$ the subspace space of Schwartz functions which is also invariant under $X$ and $P$ so that any $\psi \in {\cal S}(\mathbb R)$ can be used in Heisenberg inequalities for instance. 
In the present case there is a natural definition of $D(P)$ on the ring of length $L$, making $P$ essentially self-adjoiont: $D(P)$ is the space of $C^1$ functions such that $\psi(0)= \psi(L)$. 
In this case we find $D(PX)= \{0\}$.
(The regularity condition could be weakened using a weak notion of derivative, but this weaker version of the initial definition of $P$ does not change the final conclusion.) 
With the said definition $P$ turns out to be essentially self-adjoint  with pure point spectrum made of the points $\frac{2\pi n}{L}$ where $n \in \mathbb Z$ and I assume $\hbar=1$. The corresponding eigenvectors are
$$\psi_n(x) = \frac{e^{i 2\pi n x/L}}{\sqrt{L}}$$ 
you see that $\psi_n \not \in D(PX)$ as $[0, L] \ni x \mapsto x\psi_n(x)$ does not belong to $D(P)$. Therefore the conclusion $$\Delta P_{\psi_n} \Delta X_{\psi_n}=0$$
 does not violate Heisenberg inequality just because it is not valid with the said definition of $X$ and $P$.
On the other hand, it is disputable if these $X$ and $P$ are correct representations of the position and momentum operators because they do not satisfy the canonical commutation relations because, again,  $D(PX)= \{0\}$ and these relations require that $D(PX)\cap D(XP)$ is not trivial to have any physical sense since they are valid thereon.
Actually there is a more fundamental overall obstruction to obtain natural  physically meaningful  operators satisfying canonical  commutation relations on the ring.
Suppose that we are so clever to find out a (dense) domain of (sufficiently regular) functions $D\subset L^2([0,L], dx)$ such that our initial $X$ and $P= -i d/dx$ 
are well defined,  at least Hermitian, and  satisfy the standard commutation relations thereon. A known theorem by Nelson (actually already obtained by Dixmier in this particular case) joined with the famous Stone-von Neumann theorem establishes that, if $X^2+P^2$ is essentially self-adjoint on $D$ then there exist a unitary operator $U : L^2([0,L], dx) \to L^2(\mathbb R, dx)$ such that (the closures of) $UXU^{-1}$ and $UPX^{-1}$ are the standard self-adjoint position and momentum operators on $L^2(\mathbb R, dx)$ (*).
This is impossible because $UXU^{-1}$ would be unbounded whereas our $X$ is bounded. 
An essentially equivalent absurdum is that  $X$ would have $\mathbb R$ and not $[0,L]$ as spectrum.
In principle you may find some common domain where  $X$ (defined on the whole $L^2([0,L],dx)$) and $P$ (initially defined as a $-i$ times a derivative) satisfy canonical commutation relations and thus also Heisenberg inequality, but you have to renounce to some physical relevant property. In particular either $X$ or $P$ or $X^2+P^2$  cannot represent  observables.

(*) Actually in general, in the presence of common closed invariant subspaces,  $L^2(\mathbb R,dx)$ could be replaced by a direct orthogonal sum of severl copies of it leaving unchanged the final result.
