Is there a real valued positive function such that it and its square integrate to $1$ Does there exist a function $f : \mathbb{R} \rightarrow \mathbb{R}$ such that $f > 0$ and
$$
\int_{-\infty}^\infty f(x) dx = \int_{-\infty}^\infty f(x)^2 dx = 1.
$$
I suspect the answer is yes. I have looked at taking $f$ to be the PDF of a normal distibution $\mathcal N(0, \sigma)$ to guarantee that $f > 0$ and integrates to give $1$. I'm thinking about using IVT to find a value of $\sigma$ that works. However, in order to do this, I'm not entirely sure how to integrate $e^{x^4}$.

The solutions are actually very general. If $p$ is any PDF bounded above, $M:=\int_{\Bbb R}p^2dx\le\max p$. You can therefore take $f(x):=p(x/M)/M$.
