I just keep the cases $\pm \infty$ out, so that there are no trivial solutions such as $f(x)=x$. Can you give just not some examples but more of a general formula (if there is) for some solutions?
For what $f$ is $\int_{-\infty}^\infty f(x)\,dx = 2 \int_0^\infty f(x) \,dx \neq \pm \infty$?
-
0(1) Users should be able to understand your question from the body; currently, it is only in the title. (2) It is unclear what you are asking; use MathJax instead: http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference – 2017-01-05
5 Answers
Continuous even functions which tend to zero quickly are a class worth looking at. For example, $f(x)=\dfrac{1}{x^2+1}$.
An example of an even, continuous, function which does tend to zero for which this will not work is $g(x) = \dfrac{1}{|x|+1}$.
There are many other functions (both continuous and not) that satisfy this, though, having no absolute defining pattern. And so a formula will not be possible. For example,
$$h(x) = \begin{cases} 0 & x < -3 \\ 1 & -3\le x \le -2 \\ 0 & -2< x < 201.3 \\ 1 & 201.3 \le x \le 202.3 \\ 0 & x> 202.3\end{cases}$$
satisfies your criteria.
-
1You don't need $|f(x)| \to 0$ as $x \to \infty$, even when $f$ is continuous. – 2017-01-05
-
1Can you give an Example? Nevermind. I understand. Something like with triangles that get smaller in area should work – 2017-01-05
You don't even need the function to be even, though that is a natural thought from the statement. Some examples are below, where the long horizontal lines are meant to be the $x$ axis. Having the integral on both sides of zero is not much of a restriction. The top one has integral zero on each side of the axis.

-
0Having labels on your $y$-axis is a mistake here, I think. If you can't disable them, you need three different diagrams. – 2017-01-05
-
0Can there be continuous non even functions satisfying the conditions?? They can't, right? – 2017-01-05
-
0@jnyan: yes there can. See my answer. You only have to make sure that the functions $g$ and $h$ agree at $x=0$ (for continuity). – 2017-01-05
-
0No. When different numbers are multiplied, there will be a discontinuity at zero. – 2017-01-05
-
0@jnyan: you can make any of my functions continuous by connecting the gaps with a sloping line. As long as it is symmetric around the midpoint of the gap it will not disturb the integral equality. Even is a very restrictive condition compared to the integral condition – 2017-01-05
Hint: standard normal distribution with various standard deviation. It helps you to imagine what kind of functions satisfy your conditions. There are many other functions.
First in order $\int_{-\infty}^\infty f(x)\,dx = 2 \int_0^\infty f(x) $ your function should be even. And if we assume $f(x)$ is continuous everywhere, then for the integral to converge there should be and real number $r$ such that $f(x)<1/(x^{r1})$ for some r1>1 for $x>r$. I am not sure this is a necessary condition but it is a sufficient one.
-
0Neither of those conditions is necessary. – 2017-01-05
Let $g$ and $h$ be any two functions such that $I_g=\int_0^\infty g(x)dx$ and $I_h=\int_{-\infty}^0 h(x)dx$ exist. Then $$f(x)= \begin{cases} I_hg(x), & \text{if $x \ge 0$} \\ I_gh(x), & \text{if $x < 0$} \end{cases} $$ satisfies your condition: both sides of your equation are equal fo $2I_gI_h$.