Let $X_1,\ldots,X_n$ be a random sample from $U(0,1)$ and $X_{(1)}<\ldots<X_{(n)}$ be the corresponding order statistics.
Define, $$ R(X_1) = r\quad \text{if}\quad X_{(r)} = X_1;\quad r = 1(1)n $$ i.e. $R(X_1)$ is the rank of $X_1$ in the ordered sample. Then what will be correlation between $X_1$ and $R(X_1)$ ?
\begin{align} E[X_1R(X_1)]=\frac1n\sum_{r=1}^nr\frac{\int_0^1xx^{r-1}(1-x)^{n-r}\mathrm dx}{\int_0^1x^{r-1}(1-x)^{n-r}\mathrm dx}=\frac1n\sum_{r=1}^n\frac{r^2}{n+1}=\frac{2n+1}6\;, \end{align}
so with $E[X_1]=\frac12$ and $E[R(X_1)]=\frac{n+1}2$ we have
$$ \operatorname{Cov}(X_1,R(X_1))=\frac{2n+1}6-\frac12\cdot\frac{n+1}2=\frac{n-1}{12}\;. $$
With $\operatorname{Var}(X_1)=\frac1{12}$ and $\operatorname{Var}(R(X_1))=\frac{n^2-1}{12}$ the correlation coefficient is
$$ \frac{n-1}{\sqrt{n^2-1}}=\sqrt{\frac{n-1}{n+1}}=\sqrt{1-\frac2{n+1}}\;. $$