"God is dead" appears several times in The Gay Science, and again in Zarathustra. The first reference in TGS is:
108 New struggles.- After Buddha was dead, his shadow was
still shown for centuries in a cave-a tremendous. gruesome
shadow. God is dead;l but given the way of men, there may
still be caves for thousands of years in which his shadow will
be shown. -And we-we still have to vanquish his shadow,
too.
He puts the words into the mouths of overwrought or insane people, but it is clear he means what he is saying. He makes deductions from the statement ("God is dead... We have killed him... Must we not then make ourselves gods in order to be worthy of this act?"). And he uses those deductions in later books. For example the middle of TGS item 125 goes:
The madman jumped into their midst and pierced them with
his eyes. "Whither is God?" he cried; "I will tell you. We
have killed him-you and I. All of us are his murderers. But
how did we do this? How could we drink up the sea? Who
gave us the sponge to wipe away the entire horizon? What were
we doing when we unchained this earth from its sun? Whither
is it moving now? Whither are we moving? Away from all
suns? Are we not plunging continually? Backward. sideward.
forward. in all directions? b there stilI any up or down? Are
we not straying as through an infinite nothing? Do we not feel
the breath of empty space? Has it Dot become colder? Is not
night coatinually closing in on us? Do we not need to light
lanterns in the morning? Do we hear nothing as yet of the
noise of the gravediggers who are burying God? Do we smell
nothing as yet of the divine decomposition? Gods. too. decompose.
God is dead. God remains dead. And we have killed him.
One of the main themes of both "Beyond Good and Evil" and "Twilight of the Idols" is the creation of the elements of traditional philosophy, including God, as a projection of human needs. He opens item 5 of the Four Great Errors secton of TotI with:
The psychological explanation: to extract something familiar from
something unknown relieves, comforts, and satisfies us, besides giving us a feeling of
power. With the unknown, one is confronted with danger, discomfort, and care; the
first instinct is to abolish these painful states. First principle: any explanation is better
than none. Because it is fundamentally just our desire to be rid of an unpleasant
uncertainty, we are not very particular about how we get rid of it: the first
interpretation that explains the unknown in familiar terms feels so good that one
"accepts it as true." We use the feeling of pleasure ("of strength") as our criterion for
truth.
If God had any sort of real existence for Nietzsche, it would not be possible to create him or to kill him. (Being God, he could easily prevent this.)
The choice to say 'dead' rather than some equivalent of 'fake' indicates (to me) that he did not want to deny the effectiveness of God. God was very real in a certain way, but that very way of 'being real' was not very real.
He takes the same stance against physics if it goes beyond mere prediction or description and insists on positing specific things. God is as real as electric fields, but those fields are a pretense of another sort. They have effects, in that they give us better leverage over the use of electricity, but they exist only to explain effects, and that is not a genuine way of being real. For example in TotI, in The Four Great Errors, he ends item 3 with:
The thing itself, the concept of
thing is a mere extension of the faith in the ego as cause. And even your atom, my
dear materialists and physicists — how much error, how much rudimentary
psychology still resides in your atom! Not to mention the "thing-in-itself," the
horrendum pudendum of metaphysicians! The "spirit as cause" mistaken for reality!
And made the very measure of reality! And called God!
All crutches are equally crutches, whether from tradition, or overreaching logic. They are both projections of our needs, and not part of our experience.
(So most modern atheists, who tend to throw the role of God back on science or natural law, would have an equally hard time with his variety of atheism.)