Yes, Italy switched sides during the Second World War.
Italy was one of the Axis power. It joined the axis power in 1940. Italy fought with Germany and Japan throughout the war.
However, from October 13, 1943, after Italy surrenders to the allied forces. Italy switched to the allied forces and declared war on Nazi Germany, which was one of his Axis power partners.
The war was led by Benito Mussolini, who was the prime minister who agreed to the alliance with Nazi Germany, he was later ousted and replaced by Gen. Pietro Badoglio on July 25.
Gen Pietro sought peace with Allies, and an agreement to stop fighting was reached on September 3. Germany also later attacked and seized a stronghold from the Italian military.