Socialist Party leader Bettineo Craxi today was asked to try to form a coalition government that would end Italy's six-month-long government crisis. If he succeeds, he will be the first Socialist premier in Italian history.

Craxi, 45, said he was surprised at receiving the mandate from President Sandro Pertini, but that he would promptly begin negotiations with other political parties in an attempt to establish Italy's 42nd government since the fall of Fasciem in 1943.

Craxi faces major obstacles - not the least of which is reluctance by the Christian Democrats to give up the premiership, which they have held since 1945. Craxi was asked to form the government after acting Premier Giulio Andreotti, Chrisitan Democrat, failed to form a coalition.

Since he became party leader in 1976, Craxi has sought to steer a course between the Socialist's postwar dependence on the Communists, and its later subservience to the Christian Democrats.

To differentiate his party from the Communists, he has tightened relations with Europe's Social Democrativ parties, changed the party's emblem from a hammer and sickle to a red carnation, and taken the lead in criticizing political repression in the Soviet Union.

To fend off the smothering embrace of the Christian Democrats, he has refused to join a coalition government on any but equal terms. This action has offended some of the people whose support he must now seek.

The Socialists, Italy's third largest party made only minor gains in last month's national elections, but emerged from that vote in a swing position. Their 62 seats in the 630-members Chamber of Deputies could, in alliance with the Christian Democrats, give a coalition government a slender but workable majority.

The Christian Democrats, who along with the Communists suffered losses in the national elections, hold 262 seats - not enough to form a government without a coalition.

Last January, the powerful Communist Party began withholding parliamentary support for any coalition government that excluded the Communists from the Cabinet. The Christian Democrats repeatedly has refused to give them Cabinet posts.

Since then, Italy has not had a government capable of winning a vote of confidence.