Let $P(x)=x^3-6x$. It is easy to see that on $[1,2]$, $P$ reaches its minimum at $x=\sqrt{2}$. Among all the fractions with denominator dividing $n$, the two closest ones are $a_n=\frac{\lfloor n\sqrt{2} \rfloor}{n}$ and $b_n=\frac{\lceil n\sqrt{2} \rceil}{n}$.
Question : is it true that the natural density of the $n\geq 1$ such that $P(a_n)\lt P(b_n)$ is $\frac{1}{2}$ ? In other words, if $r_N$ denotes the number of $n$'s in $[1,N]$ such that $P(a_n) \lt P(b_n)$, does $$\frac{r_N}{N}\to \frac{1}{2} \ \textrm{when} \ N \to \infty\tag{1}$$ ?
What I tried : with PARI-GP, I realized that the following much stronger property holds for $N\leq 10^6$ :
$$ 0 \leq \frac{r_N}{N}-\frac{1}{2} \leq \frac{8}{N}$$
and both the lower and upper bounds are attained very often.
This is true: the natural density of those $n$ with $P(a_n)<P(b_n)$ is $1/2$. To see this, writing for brevity $u_n:=\lfloor n\sqrt 2\rfloor$ and $v_n=\lceil n\sqrt 2\rceil$, notice that the inequality $P(a_n)<P(b_n)$ can be written as $$ \left(\frac{u_n}n\right)^3 - 6\,\frac{u_n}n < \left(\frac{v_n}n\right)^3 - 6\,\frac{v_n}n; $$ equivalently, $$ \frac{v_n-u_n}n\,\frac{u_n^2+u_nv_n+v_n^2}{n^2} > 6\,\frac{v_n-u_n} n, $$ or $$ v_n^2+v_nu_n+u_n^2 > 6n^2. $$ Observing that $v_n=u_n+1$, this is further equivalent to \begin{align*} 3u_n^2+3u_n+1 &> 6 n^2, \\ u_n^2+u_n &\ge 2n^2, \\ (u_n+0.5)^2 &> 2n^2, \\ u_n + 0.5 &> n\sqrt 2, \\ \{n\sqrt 2\} &< 0.5, \tag{$\ast$} \end{align*} where $\{n\sqrt 2\}=n\sqrt 2-u_n=n\sqrt 2-\lfloor n\sqrt 2\rfloor$ is the fractional part of $n\sqrt 2$. Finally, the natural density of those $n$ satisfying ($\ast$) is $0.5$, as a very special particular case of the well-known equidistribution theorem.