Calculate the limit of a function involving greatest integer function 
If $f:(0,\infty)\rightarrow\mathbb{N}$ and
$$f(x)=\left[\frac{x^2+x+1}{x^2+1}\right]+\left[\frac{4x^2+x+2}{2x^2+1}\right]+\left[\frac{9x^2+x+3}{3x^2+1}\right]+\cdots+\left[\frac{(nx)^2+x+n}{nx^2+1}\right]$$
Find the value of $$\lim_{n\rightarrow\infty}\left[\frac{f(x)-n}{(f(x))^2-\frac{n^3(n+2)}{4}}\right]$$
where $[.]$ denotes the greatest integer function.

I am not able to calculate $f(x)$. Like if I'll put summation on the $nth$ term, how will I calculate it$?$ Moreover, how will I handle the greatest integer function.
Any help is greatly appreciated.

$f(x)$ is easy to calculate once you simplify the algebraic expressions under it.
$f(x)=\begin{equation}
\sum_{k=1}^{n}\left[\frac{(nx)^2+x+n}{nx^2+1}\right]
\end{equation}$
$\left[\frac{(nx)^2+x+n}{nx^2+1}\right] = \left[\frac{(nx)^2+n}{nx^2+1}+\frac{x}{nx^2+1}\right]$
$=\left[\frac{n(nx^2+1)}{nx^2+1}+\frac{x}{nx^2+1}\right]$
$=\left[{n}+\frac{x}{nx^2+1}\right]$
Since $x < nx^2+1$ , the expression can be evaluated to n.
Hence, $f(x) = \sum_{k=1}^{n}n = \frac{n(n+1)}{2}$
$\lim_{n\rightarrow\infty}\left[\frac{f(x)-n}{(f(x))^2-\frac{n^3(n+2)}{4}}\right]$
Substituting the value of $f(x)$ , the limit simplifies to,
$\lim_{n\rightarrow\infty}\left[\frac{2(n-1)}{n}\right]$
Hope this is enough to evaluate the limit.
