Yes, Italy switched sides during the World War II. On 27th of September, 1940 Italy alongside with Japan and Germany signed Tripartite which officially formed the Axis power of the Second World War. Italy joined because of the treaty of London and because of the aim of taking over colonies belonging to the British and French in North Africa. The initial attempts of the Italian forces were successful as there were many bombings by the Italians, invasion of Egypt and British Somaliland.
Despite increased opposition from Germany the Allied forces continued to advance through Italy and with time, The Allied forces took over most part of southern Italy. In 1945, the allied had a final victory over Italy and Italy surrendered to the Allied forces. Italian forces fought alongside the Allies for the rest of the war. Hope you find this information helpful.