The following result is well-known (I consider the 3-dimensional case only):

**Theorem:** if $f \in H^s(\mathbb{R}^3)$ with $ s > 3/2$ is compactly supported, then
$$
\left| \int_{\mathbb{R}^3} f - \frac{1}{N^3} \sum_{k \in \mathbb{Z}^3} f \left (\frac{k}{N}\right)\right| \le C_s \dfrac{\| f \|_{H^s}}{N^s}.
$$
Recall that $H^{3/2}(\mathbb{R}^3) \hookrightarrow C^0(\mathbb{R}^3)$ so that the point-wise estimates make sense.

Now, I consider the following function. Let $\Psi$ be a $C^\infty(\mathbb{R}^3)$ radial cut-off function with $\Psi(0) = 1$ and $\Psi(x) = 0$ if $| x | > 1$, and let
$$
f(x) = \frac{(x_1)^4}{| x |^4} \Psi(x).
$$
I also set $f(0) = 0$ to simplify the notation. Note that $f$ is not continuous at the origin (hence $f \notin H^{3/2}(\mathbb{R}^3)$).

**The question is:** what is the best constant $s$ so that
$$
\left| \int_{\mathbb{R}^3} f - \frac{1}{N^3} \sum_{k \in \mathbb{Z}^3} f \left (\frac{k}{N}\right)\right| \le C_s N^{-s} \quad ?
$$
Numerically, I observe $s = 3$ (with no doubt possible). I even observe that there exists a constant $C$ such that
$$
\forall N, \quad \left| \int_{\mathbb{R}^3} f - \frac{1}{N^3} \sum_{k \in \mathbb{Z}^3} f \left (\frac{k}{N}\right) - \frac{C}{N^3}\right| \approx 0.
$$
Unfortunately, I have a hard time to prove this fact (I got a proof for all $s < 3$,...).

**Remark:** if we change the power $4$ to the power $2$, then a simple symmetry argument shows that $s = 3$, and the constant $C$ corresponds to a missing part in the Riemann-sum (__i.e.__ the $k = 0$ term).