What is the use of dreams in the book "All Quiet on the Western Front"?As in what are they used to portray...?
Most often in All Quiet on the Western Front, dreams come in the form of daydreams or flashbacks. Often, when Paul is "resting" on the front lines (on watch late at night, riding in a lorry, or during other high stress down time) he thinks back to his school days, the street where he grew up, and the way things used to be.
Generally speaking, these daydreams and flashbacks are used for a few purposes. One, they are a mental release that Paul's mind provides from the unimaginably high stress he is under as a foot-soldier fighting for his life and the lives of others. When things are chaotic (heavy bombardment, seeking shelter, etc.) the soldiers are "like animals" in that they are fueled by instinct and adrenaline. That is why their minds travel during the times of silence, back to the past.
Another purpose for the daydreams and flashbacks is to give the audience a picture of where these boys came from. One theme of this story (and historically, a theme for this time in history) is the idea that the young men who went off to war came back as a lost generation. They were so young when they enlisted that they never experienced the dream of having their own families and careers (or even finishing their education) but when they returned, they were so jaded and so greatly aged by their traumatic experience that many did not know what to live for once the war was over. Paul's flashbacks bring him back to times when he believed he had a purpose/goal in life. They then present the contrast to the way he thinks/feels as a result of the death and destruction of the war. He no longer has a purpose beyond survival. He cannot imagine his life after the war, but cannot help but question his life (and purpose) before the war either.
Finally, speaking from a literary sense, the daydreams and flashbacks are all of more peaceful times. This presents a direct contrast to the action, destruction, and death presented in the scenes of direct fighting. It would be difficult to appreciate a book that was only filled with death and destruction. Paul's flashbacks remind the reader that these men are human, and though they must act like machines in order to stay alive, they are made of memories and desires that reveal a sensitivity inside of them.