Show that if the integral of function with compact support on straight line is zero, then $f$ is zero almost everywhere
The problem you pose is the weak version of a classical result in harmonic analysis, which does not require the continuity nor the compactness of the support of the datum $f$: in order to prove this stronger result, first note that $$ \begin{align} \int\limits_{\Bbb R} f\big(l(t)\big)\mathrm{d}t=0\:\text{ for every}&\text{ straight line } l\subsetneq\Bbb R^2\label{1}\tag{1}\\ \Updownarrow&\\ \int\limits_{\sigma(l_0)} f(l)\,\mathrm{d}l=0\:\text{ for every rigid }&\text{motion }\sigma\in\mathsf{Aut}(\Bbb R^2)\label{2}\tag{2} \end{align} $$ where by rigid motion we mean a bijection of $\Bbb R^2$ in itself which is the composition of a rotation and a translation and $l_0\subsetneq\Bbb R^2$ is a given straight line: this is obvious, since substituting a dilatation of a given straight line $l$ in \eqref{1} does not change the value of the integral, thus these linear transformations do not contribute to it and it is not necessary to consider them. Now we can state and prove the following:
Theorem (Cramér & Wald, Newman, Besicovitch). If $f\in L^1(\Bbb R^2)$ is such that, for an arbitrarily given straight line $l_0\subsetneq\Bbb R^2$, equation \eqref{2} holds, then $f\equiv 0$ a.e..
Proof. Let $\xi=(\xi_1,\xi_2)\neq 0$ so that $\Vert \xi\Vert\neq0$ and define $(x,y) \mapsto \sigma_{\Vert \xi\Vert}(x,y)=(u,v)$ as
$$
\begin{pmatrix}
u\\
v
\end{pmatrix}=
\begin{pmatrix}
\frac{\xi_1}{\Vert \xi\Vert}& \frac{\xi_2}{\Vert \xi\Vert}\\
-\frac{\xi_2}{\Vert \xi\Vert}& \frac{\xi_1}{\Vert \xi\Vert}
\end{pmatrix}
\begin{pmatrix}
x\\
y
\end{pmatrix}\quad\forall (x,y)\in\Bbb R^2
$$
The Jacobian of $\sigma_{\Vert \xi\Vert}$ is equal to one therefore, by applying the Fourier transform to $f$, we get
$$
\begin{split}
\hat{f}(\xi)&=\iint\limits_{\Bbb R^2} e^{-i\langle\xi,(x,y)\rangle}f(x,y)\,\mathrm{d}x\mathrm{d}y\\
&=\int\limits_{\Bbb R} e^{-i\Vert\xi\Vert u} \left[\,\int\limits_{\Bbb R}f\big(\sigma_{\Vert \xi\Vert}^{-1}(u,v)\big)\,\mathrm{d}v\right] \mathrm{d}u=0
\end{split}
$$
since the integral inside the square brackets in the right side of the above equality is equal to \eqref{2} for some $\sigma=\sigma_{\Vert \xi\Vert}(u,\cdot)$. By the arbitrariness of $\xi\in\Bbb R^2\setminus\{0\}$, $f\equiv 0$ a.e.. $\blacksquare$
Final notes
- When I saw the question and the comment by Christian Blatter, I though this was a classical problem for the Radon transform. However, I saw the comment of mathworker21, I remembered a counterexample and the fact that this is in reality a result related to the Pompeiu problem: I found the above simple and beautiful theorem in reference [1] (Theorem 1, p. 26) while looking for that example.
- Finally, Chakalov's example ([1], p. 27) shows that disks have not the Pompeiu property, i.e. there exists (even very smooth) functions $f$ such that, for many (even infinitely many) $r>0$,
$$
\int\limits_{B(x_0,r)} f(y)\,\mathrm{d}y=0\quad \forall x_0\in\Bbb R^2,\; \text{ does not imply }f\equiv 0\, \text{a.e.}
$$
where $x_0=(x_{0,1},x_{0,2})$ and $y=(y_1,y_2)$ are points in $\Bbb R^2$.
Edit. Following the comment of mathworker21, I checked Chakalov's example as reported in [1], and I found that integral formula (2) in the paper is flawed by typos. The correct one is given by Garofalo and Segala in [2], p. 137, and for the completeness I report it here. If we choose $f(x,y)=\sin(ax)$, $a>0$ then we have $$ \int\limits_{B(x_0,r)} f(x,y)\,\mathrm{d}x\mathrm{d}y=\frac{2\pi r}{a}\sin(ax_{0,1})J_1(ar) $$ where $J_1$ is the first kind Bessel function of order $1$. Choosing $a$ such that $ar$ is a zero of $J_1$ makes the above integral zero for any $x_0\in\Bbb R^2$. Note that the example works also in dimension $n>2$, for the higher dimensional analogue of the Pompeiu problem.
References
[1] Nicola Garofalo (1989), "A new result on the Pompeiu problem", Rendiconti del Seminario Matematico, Torino, Fascicolo Speciale "PDE and Geometry", vol. 46, 25-38 (1989), MR1086204, Zbl 0737.35145
[2] Nicola Garofalo and Fausto Segala (1994), "Univalent functions and the Pompeiu problem", Transactions of the American Mathematical Society, 346, 137-146, MR1250819, Zbl 0823.30027.
Suppose there exists $p\in\mathbb{R}^2$ with $f(p)\neq 0$, then WLOG (by replacing $f$ by $-f$ if necessary) we might assume $f(p)>0$. But then by continuity of $f$ there exist $\varepsilon>0$ such that $f(x)>f(p)/2$ for all $x$ with $\|x-p\|\leq\varepsilon$, which then gives that the integral of $f$ over every line contained in $B(p,\varepsilon)$ is strictly positive, contradiction.