How did World War I affect philosophy?
This is a huge question that can't be adequately dealt with short of a book length treatise, but an outline of a few of the effects of the war can be touched on. First, World War I was so obviously a huge mistake and a wasteful bloodbath that left European and American philosophy reeling. Nineteenth-century optimism and belief in progress had been undergirded by enlightenment notions of philosophic rationalism, a belief that humankind could gather the correct data and make decisions that would work in favor of making the world an ever-better place to live.
World War I punched a hole in the idea of rationalism. As a result, philosophical or related systems that took into account the dark irrationality of the human psyche gained traction, such as Freud's theories of the unconscious. These were, strictly speaking, psychology, but they had a huge impact on early- to mid-twentieth century philosophical thought. Philosophical nihilism gained more traction: nihilism rejects value-based thinking and offers a pessimistic view of human existence, while being skeptical that "truth" can ever be known or even has reality.
In Germany, the shock and humiliation of losing World War I sent philosophy into its own dark spaces. Right-wing philosophies of "blood and soil" and the mystical worldview of the Germanic spirit challenged enlightenment (especially French) liberalism and ideas of universal brotherhood to embrace ideas of a special world destiny for the Aryan race.
Nietzsche is an important post-war figure. Looking at the ruin and carnage wrought by a world war, European intellectuals began to embrace the idea that perhaps humans are caught, as Nietzsche contended, in a prison house of language and perception that lead us into dark places. This idea began to overshadow the idea that language and perception were a clear windowpane leading to truth.
We are still living in the aftermath of a post-World War I shaking up of confidence in the power of humankind's rationalism. As philosophy since Socrates and Plato has been based on rationalism, the entire field of philosophy has been shaken up .
The First World War had a direct effect on philosophy much as philosophical thinking had an effect on the discourse around the war, and especially during the inter-war years from 1918 until 1939. To fully answer this would take a book, so I will focus on one case study: that of the Viennese philosopher, Ludwig Wittgenstein. Wittgenstein wrote his Tractatus-Logico-Philosophicus while he was a prisoner of war (while in the Austrian Army) in Italy. This was a book that heavily influenced logic and the philosophy of language in the twenties and the thirties. Raymond Monk, Wittgenstein's biographer, claims that the experiences of the war led Wittgenstein to have an interest in philosophy that went beyond the traditional boundaries of philosophy and, further, led him to connect the diverse areas of philosophical study. This was also true for other philosophers and, earlier distinct sub-fields like ethics and philosophy of language came to be much more closely connected in the wake of the war.
In some ways, World War I simply exacerbated intellectual developments that had been going on for a long time. But it certainly contributed to a sense of alienation from traditional western ideas among intellectuals. In terms of actual academic philosophy, the period after World War I saw the rise (though not the beginning) of existentialism, a philosophical movement that emphasized man's aloneness in the world, which, many existentialists held, ought to create a sense of freedom and individual responsibility. German existentialist Martin Heidegger argued for an approach that did not imagine people in terms of a metaphysical eternity, but rather in terms of their being, i.e., their life on Earth. While not a existentialist as such, Ludwig Wittgenstein claimed that philosophy was essentially incapable of providing answers to large, metaphysical questions. In general, philosophy during this period, and on into World War I, emphasized a turning away from metaphysical solutions and the comforts of religion and rationalism. World War I exacerbated this trend.