What was the primary role of Italy in the WWII?
Nearly four million Italians served in the Italian Army during the Second World War and nearly half a million Italians (including civilians) died between June 1940 and May 1945.
Italy while contributing troops to the Eastern Front (200,000) mainly served as Germany's ally in securing the Mediterranean. Most of the forces under Rommel in North Africa were in fact Italian and not German, the Afrika Corps was a small part of the forces fighting the British in North Africa.
The Italians contributed the bulk of Axis naval units in the Meditterean, even after the British successful attack on the Italian navy at Taranto in 1940. The Italian navy did not attempt to confront British capital ships with its own, but it did provide trouble for British convoys. Italy required German help not only in North Africa, but also in Greece. They did successfully wrest British Somalialand from the British without German aid.
After Italy's armistice with the Allies in 1943, some Italians fought alongside the allies in combat and as support units in the Italian Co-Belligerent army. Some 50,000 in combat and 200,000 in support. Others given the choice by the Germans to be interned (and used as slave labor) or fight with their old allies chose to fight with Germany. Over 90,000 chose this option. Thousands of Italian troops in the Balkans joined up with resistance fighters in 1943 and their was a strong Italian resistance to the Germans behind the lines.
The main problem for the Italians in WW2 as allies of the Germans is that they were poorly equipped compared to their German allies and their British opponents. This no doubt had an effect on morale and fighting spirit as well. Italy entered the war in 1940 believing it was almost over and eager to grab some spoils, but it was woefully unprepared and faltered even as the allies seemed on the ropes, and as the war dragged on, these deficiencies became even more pronounced.
Italy was, of course, a member of the Axis Powers in World War II. However, Italy was not really much of a help to their allies. It can, in fact, be argued that the presence of Italy in the Axis coalition actually helped the Allies.
Italy needed to be bailed out by the Germans a number of times. Their military undertook offensive operations that it could not win, at which point German forces had to take over. This meant that German forces were pinned down fighting in places that they would not have fought had it not been for Italy. This, obviously, reduced Germany's ability to win the war.
Near the end of the war, Italian forces surrendered to the Allies, making a separate peace with them. This did not do much to affect the war, however, because German forces continued to occupy Italy and resist the Allied move up the Italian Peninsula.