Consider a hollow spherical charge with density $\rho'$ continuously varying only with respect to distance from the center $O$.
$V'=$ yellow volume
$k \in \mathbb {R}$
$\forall$ point $P$ inside the hollow sphere, electric field is zero. Now I have to prove the following two theorems:
$(1)$ Given: $\vec{E}_P=\displaystyle\int_{V'}\rho'\ f(r) (\hat{r})=0$.
To prove: $f(r)=\dfrac{k}{r^2}$
$(2)$ Given: $\vec{E}_P=\displaystyle\int_{V'}\rho'\ \vec{f}(r) = 0$.
To prove: $\vec{f}(r)=\dfrac{k\ \hat{r}}{r^2}$
Can we prove these two theorems? If yes for any, please help me to prove it.

It's convenient to work with a potential $u$ so $\vec{f}=-\nabla u$. For (2) to hold for arbitrary spherically symmetric $\rho$, it must in particular work when $\rho=m\delta^3(r-a^\prime)$, viz.$$\partial_p\int_0^\pi d\theta\sin\theta u\left(\sqrt{p^2+a^{\prime2}-2pa^\prime\cos\theta}\right)=0.$$Substitute $r^2=p^2+a^{\prime2}-2pa^\prime\cos\theta$ so$$\partial_p\int_{a^\prime-p}^{a^\prime+p}\frac{rdr}{p}u(r)=0.$$But then$$\int_{a^\prime-p}^{a^\prime+p}ru(r)dr\propto p\implies(a^\prime+p)u(a^\prime+p)+(a^\prime-p)u(a^\prime-p)=\operatorname{constant},$$and the case $a^\prime=0$ shows this constant is $0$, provided we identify a radius of $-p$ with one of $p$. So$$u(r)\propto\frac1r\implies \vec{f}(r)\propto\frac{\hat{r}}{r^2}.$$The treatment of (1) is similar.