The Bible doesn't directly answer the question of whether or not God is selfish because no one in ancient times probably thought to ask it. It is a very contemporary question. In the past few years, it has become popular to say that God is selfish or even egotistical. People who don't believe in God will often say this because they want to show that the way God is shown in the Bible is not really good. It is often said that "the God of the Bible made everything for His own glory and then tells his creatures that they must worship and obey Him or they will be tortured forever in hell."
It seems that the more selfish a person is, the more it bothers him when he thinks other people are selfish. A really selfless child won't get mad when another child doesn't want to play with his toys. When someone is selfish, they draw attention to themselves when they don't deserve it. God is the only perfect being in the universe, so he deserves all the attention, praise, and worship that is given to him. Any claim that God is selfish comes from the fact that people want to take the place that God should take. Only because of our own selfishness can we say that God is selfish.
From the beginning of time, God was everything He needed to be. He didn't need to make other beings in order to feel complete. There was perfect love and fellowship among the three parts of the Trinity. The only reason God made us is so that we could also feel His love and perfection. Saying that God is selfish is like a 5-year-old saying that his parents are selfish because they won't buy him every toy he wants. Also, his parents have the nerve to ask him to help with household chores. In fact, they want him to always respect them and do what they say. Even when he knows more than them, they still want him to do what they say. The only thing the child can think of is that his parents are very self-centered.
C. S. Lewis says, "God made us; he thought of us like a man would think of an engine. A car is made to run on gasoline, and nothing else would work as well. Now, God made us so that we can run on Himself. He is the fuel that our spirits were made to burn, or the food that our spirits were made to eat. There is nothing else. That's why we shouldn't ask God to make us happy in the way we want. God can't give us peace and happiness outside of Himself, because they don't exist. "There is no such thing." By nature, we don't want to obey God and actively try to get rid of Him so we can stay in charge and be gods in our own right. God could have just let us go our own miserable way, and that would have been fine. (This is a big part of hell, no matter what else it might be about.) But God's love for us was shown by the fact that Christ died for us while we were still bad people (Romans 5:8). We can be forgiven because God doesn't care about himself.