user533: Is there any reference in Buddhism about how our life was before life has appeared on this earth? Were we all in heaven or hell realms?

user625: I would say that our goal is to free ourselves from the notions of "life" and "non-life", from "before" and "after".
"We
are
scared
because
of
our
notions
of
birth
and
death,
increasing
and
decreasing,
being
and
non-­‐being.
Nirvana
means
extinction
of
all
notions
and
ideas.
If
we
can
become
free
from
these
notions
we
can
touch
the
peace
of
our
true
nature.
There
are
eight
basic
concepts
that
serve
to
fuel
our
fear.
They
are
the
notions
of
birth
and
death,
coming
and
going,
the
same
and
different,
being
and
non-­‐being.
These
notions
keep
us
from
being
happy.
The
teaching
given
to
counteract
these
notions
is
called
"the
eight
no's,"
which
are
no
birth,
no
death,
no
coming,
no
going,
not
the
same,
not
different,
no
being,
no
non-­‐being."
No
Death,
No
Fear:
Comforting
Wisdom
for
Life
by
Thich
Nhat
Hanh
2003
pg
51
–
53

user749: I suggest you take a look at the Dhammapada which is part of the Pali Canon if you are interested in Buddhism. 
The Buddha taught that such questions weren't important. He rather encouraged people to focus on the life here and now. There are a few dialogs in the Pali Canon in which Buddha answers his apprentice's similar question with a metaphor.

user111: At the end of a Maha Kalpa, if the world system gets destroyed by fire, all the Brahma, Deva, human and hell realms below Abhassara Brahma realm get destroyed. But once the earth is reformed, beings come back from the Abhassara Brahma realm to populate the earth once more. Agganna Sutta hints that the last time, it was destroyed by fire while the Sapthasuriyuggamana sutta says that this time also it is going to be destroyed by fire. The pattern is: 7 times by fire, 1 time by water and at the 64th repetition, it will be destroyed by air.
"Abhassara brahmas" means Brahmas with streaming radiance. They feed on delight, self luminous and glorious. Abhassara realm is said to be located 5508000 Yojanas away from the human realm. One has to cultivate the 2nd Jhana to the highest degree to be born there. There are two more Brahma realms at the same level. Appamanabha(2nd Jhana- medium degree), Parittabha(2nd Jhana- minor degree).
The lifespan of an Abhassara Brahma is 7 Maha-kalpas since the Abhassara realm also gets destroyed at the 8th time. One day there lasts an Asankya(10 to the power 140) human years. 
1 Maha-kalpa = 4 Asankya-kalpa
1 Asankya-kalpa = 64 Antah-kalpa
1 Antah-kalpa = time period it takes for the human lifespan to increase from 10 to Asankya and drop down to 10 again. The increase or decrease said to happen at a rate of 1 year per every 100 years.
Apart from them, there are other beings with Nihilistic(no rebirth, no karma etc.) views who refuse to do good deeds and cultivate Jhana to get into higher Brahma realms. They get caught in the destruction of the world and are born in an Asura hell called the Lokantarika Narakaya. There is no mention as to if they ever get to come back when the new world system is formed. It is said to be situated at the center of three worlds - the human world, the ordinary hells and heavens.
At the center of these three worlds, there is a dark sea of acid water surrounded by rocky mountains. This sea is covered with eternal darkness; no ray of light can reach this place.  The creatures of the Lokantarika-niraya hang themselves on cliffs like bats. They are tortured by hunger and thirst as there is no food for them. While moving along the cliff they sometimes come across each other.  Thinking that they have come across food, they jump upon each other and start fighting. As soon as they start fighting, they let loose their grip on the cliff and as a result they fall into the sea below and their bodies melt away just like salt melting away in water.

533: <p>Is there any reference in Buddhism about how our life was before life has appeared on this earth? Were we all in heaven or hell realms?</p>
 625: <p>I would say that our goal is to free ourselves from the notions of "life" and "non-life", from "before" and "after".</p>

<p>"We
are
scared
because
of
our
notions
of
birth
and
death,
increasing
and
decreasing,
being
and
non-­‐being.
Nirvana
means
extinction
of
all
notions
and
ideas.
If
we
can
become
free
from
these
notions
we
can
touch
the
peace
of
our
true
nature.</p>

<p>There
are
eight
basic
concepts
that
serve
to
fuel
our
fear.
They
are
the
notions
of
birth
and
death,
coming
and
going,
the
same
and
different,
being
and
non-­‐being.
These
notions
keep
us
from
being
happy.
The
teaching
given
to
counteract
these
notions
is
called
"the
eight
no's,"
which
are
no
birth,
no
death,
no
coming,
no
going,
not
the
same,
not
different,
no
being,
no
non-­‐being."</p>

<p>No
Death,
No
Fear:
Comforting
Wisdom
for
Life
by
Thich
Nhat
Hanh
2003
pg
51
–
53</p>
 749: <p>I suggest you take a look at the <a href="http://www.accesstoinsight.org/tipitaka/kn/dhp/dhp.intro.budd.html" rel="nofollow">Dhammapada</a> which is part of the Pali Canon if you are interested in Buddhism. </p>

<p>The Buddha taught that such questions weren't important. He rather encouraged people to focus on the life here and now. There are a few dialogs in the Pali Canon in which Buddha answers his apprentice's similar question with a metaphor.</p>
 111: <p>At the end of a Maha Kalpa, if the world system gets destroyed by fire, all the Brahma, Deva, human and hell realms <a href="http://www.accesstoinsight.org/ptf/dhamma/sagga/loka.html" rel="nofollow">below Abhassara Brahma realm</a> get destroyed. But once the earth is reformed, beings come back from the Abhassara Brahma realm to populate the earth once more. <a href="http://www.columbia.edu/itc/religion/f2001/edit/docs/aggannasutta.pdf" rel="nofollow">Agganna Sutta</a> hints that the last time, it was destroyed by fire while the Sapthasuriyuggamana sutta says that this time also it is going to be destroyed by fire. The pattern is: 7 times by fire, 1 time by water and at the 64th repetition, it will be destroyed by air.</p>

<p>"Abhassara brahmas" means Brahmas with streaming radiance. They feed on delight, self luminous and glorious. Abhassara realm is said to be located 5508000 <a href="http://en.wikipedia.org/wiki/Yojana" rel="nofollow">Yojanas</a> away from the human realm. One has to cultivate the <a href="http://www.accesstoinsight.org/ptf/dhamma/sacca/sacca4/samma-samadhi/jhana.html#j2" rel="nofollow">2nd Jhana</a> to the highest degree to be born there. There are two more Brahma realms at the same level. Appamanabha(2nd Jhana- medium degree), Parittabha(2nd Jhana- minor degree).</p>

<p>The lifespan of an Abhassara Brahma is 7 Maha-kalpas since the Abhassara realm also gets destroyed at the 8th time. One day there lasts an Asankya(10 to the power 140) human years. </p>

<p>1 Maha-kalpa = 4 Asankya-kalpa</p>

<p>1 Asankya-kalpa = 64 Antah-kalpa</p>

<p>1 Antah-kalpa = time period it takes for the human lifespan to increase from 10 to Asankya and drop down to 10 again. The increase or decrease said to happen at a rate of 1 year per every 100 years.</p>

<p>Apart from them, there are other beings with Nihilistic(no rebirth, no karma etc.) views who refuse to do good deeds and cultivate Jhana to get into higher Brahma realms. They get caught in the destruction of the world and are born in an Asura hell called the <a href="http://www.mahindaramatemple.com/e-library/31planes1.htm" rel="nofollow">Lokantarika Narakaya</a>. There is no mention as to if they ever get to come back when the new world system is formed. It is said to be situated at the center of three worlds - the human world, the ordinary hells and heavens.</p>

<p>At the center of these three worlds, there is a dark sea of acid water surrounded by rocky mountains. This sea is covered with eternal darkness; no ray of light can reach this place.  The creatures of the Lokantarika-niraya hang themselves on cliffs like bats. They are tortured by hunger and thirst as there is no food for them. While moving along the cliff they sometimes come across each other.  Thinking that they have come across food, they jump upon each other and start fighting. As soon as they start fighting, they let loose their grip on the cliff and as a result they fall into the sea below and their bodies melt away just like salt melting away in water.</p>
