A non-zero function on $\mathbb{R}^n$ whose integral over any ball of radius $1$ is zero? Does there exist a measurable function $f:\mathbb{R}^n\rightarrow\mathbb{R}$, for some $n>1$, which is not equal to $0$ almost everywhere such that for any ball $B$ of radius exactly $1$ we have
$$\int_Bfd\mu=0,$$
where $\mu$ is the Lebesgue measure on $\mathbb{R}^n$?
Motivation:
In my original thought, I substituted the shape of ball with another (fixed) convex shape and I let this integral rule hold for all these shapes and at all scales. I proved that in that case the only function is that which is equal to $0$ a.e. My goal was to restrict this integral rule to shapes of the scale equal to $1$ only, but then I figured that it is not enough to conclude $f=0$ a.e. if we took the hypercube to be our convex shape, for example. I was then wondering, does for any shape there exist a counter-example? That's my question reduced to the case when the shape is the ball.
The solution for the case when $B$'s are the cubes of side length $2$:
$$f(x)=-1+2\bigg(\Big(\sum_{k=1}^n\lfloor x_k\rfloor\Big)\;\text{mod}\;2\bigg),$$
where $\lfloor x_k\rfloor$ is the floor of the $k$-th coordinate of $x$.
 A: For $n=1$ take the function
$$\int_{B}\sin(\pi x)\:d\mu = 0$$
for all balls of radius $1$ in $\Bbb{R}$
A: For unit ball $B = \{ x \in \mathbb{R}^n : |x| \le 1 \}$, the answer is YES.
In general, for any $n > 1$ and convex body $K \subset \mathbb{R}^n$ (convex, compact, non-empty interior).
If one can find a $k \in \mathbb{R}^n$ such that
$$\int_K e^{ik\cdot x} d\mu = 0$$
then for all function of the form
$f(x) = \Re(A e^{ik\cdot x})$ where $A$ is a constant and translated copy of $K$:
$K_t = \{ x + t : x \in K \}$, we have
$$\int_{K_t} f(x) d\mu = \int_K f(x+t) d\mu
= \Re\left(A e^{ik\cdot t} \int_K e^{ik\cdot x} d\mu\right) = 0$$
Back to the original problem where $K = B$. Using rotation and reflection symmetry,
it just suffices to search for a $k \in (0,\infty)$ such that
$$\int_0^1 \cos(kx) (1-x^2)^{\frac{n-1}{2}} dx = 0\tag{*1}$$
Recall following integral representation of Bessel function${}^{\color{blue}{[1]}}$:
$$J_{\nu}(z) = \frac{2(z/2)^\nu}{\pi^{1/2}\Gamma(\nu + \frac12)} \int_0^1 (1 - t^2)^{\nu-\frac12}\cos(zt)dt$$
Condition $(*1)$ is equivalent to $J_{\frac{n}{2}}(k) = 0$.
Notice for fixed $\nu$ and $x \to \infty$, we have following asymptotic behaviour
${}^{\color{blue}{[2]}}$:
$$J_{\nu}(x) = \sqrt{\frac{2}{\pi x}}\left[\cos\left(x - \frac{\nu}{2}\pi - \frac14\pi\right) + o(1)\right]$$
This means $J_{\frac{n}{2}}(z)$ vanishes infinitely many often on $(0,\infty)$, so we have tons of $k$ to satisfy $(*1)$.
Notes

*

*$\color{blue}{[1]}$ - see $\S 10.9.4$ on DLMF.

*$\color{blue}{[2]}$ - see $\S 10.7.8$ on DLMF.

