Hitler was inspired by anti-Semitism because it was a predominant ideology in Nazi Germany. The Nazis built upon centuries of anti-Jewish sentiment, and Hitler used anti-Semitic ideas that had been around for a long time. Jews in Europe had been victims of discrimination and persecution since the Middle Ages, often for religious reasons.
In the nineteenth century, religion played a less important role, and it was replaced by theories about the differences between races and peoples. The idea that Jews belonged to a different people than the Germans, for instance, caught on. Hitler developed his political ideas in Vienna, a city with a large Jewish community, where he lived from 1907 to 1913.
During the First World War, Hitler was a soldier in the German army, and at the end of the war, he, and many other German soldiers like him, could not get over the defeat of the German Empire. The German army command spread the myth that the army had not lost the war on the battlefield, but because they had been betrayed. Hitler bought into the myth, and Jews and communists had betrayed the country and brought a left-wing government to power that had wanted to throw in the towel