# A function that is a tight and smooth estimation of the nth prime function?

Does it exist a given explicit function $f:\mathbb N\to\mathbb R$ such that forall N big enough $\exists m,n\in\mathbb N: m,n>N \wedge f(m)\leq p_m\wedge f(n)\geq p_n$?

A literal answer to your question: $f(x)=p_{\lfloor x\rfloor}$ works. But I think you want something stronger than merely being "explicit", more like a finite-length formula over well-known functions.
Littlewood proved in 1914 that for all $N$ there are $n,m>N$ such that $$\operatorname{li}(m)\le\pi(m)\ \vee\ \operatorname{li}(n)\ge\pi(n).$$ The usual citation is [1] though I have not read the paper (it is in French). It is likely that for all $N$ there are $n,m>N$ such that $$¿\qquad\operatorname{li}^{-1}(p_m)\le m\ \vee\ \operatorname{li}^{-1}(p_n)\ge p\qquad?$$ but I cannot immediately prove this.