No, the devil isn't just an idea that people dreamed up to explain why there's evil in the world. The devil is real, and ultimately he is behind all the sin and evil of this world.
What is the devil? The Bible says he is a very powerful and evil spiritual force -- far more powerful than any human power or authority. The Bible says he is our adversary or opponent, and his all-consuming goal is to block God's work and take over as the ruler of the universe (and of our lives). The Bible says, "Be self-controlled and alert. Your enemy the devil prowls around like a roaring lion looking for someone to devour" (1 Peter 5:8).
Although the Bible doesn't answer all our questions about Satan, it indicates that originally he was an archangel created by God to serve Him. But he led a rebellion against God and tried to put himself in God's place. Since that time, he has been in constant conflict with God, and that spiritual battle will continue until the end of the present age. Then Satan will be defeated, never to bother us again.
The real question, however, is this: Whom are you serving? Are you serving the devil (even if you don't see it that way) -- or are you serving God? Don't be on the losing side, but turn your life over to Jesus Christ and make it your goal to live for Him every day.