Why is/was the IRA Marxist in ideology and how has that changed over time? What was the reason for affiliation with the Palestine Liberation Organization? Did they work with Black September? Did this relationship change after the Sabra and Shatila massacre?
Thanks!
The IRA-PLO relationship has it's roots long before the birth of either organisation. I'll try and keep this short as it's a fairly broad topic.
As an Irish national identity became to form in the late 1700s and early 1800s they began to look at the world around them for 'fraternal' causes, Ireland became a hot bed of abolitionism especially under Daniel O'Connell when Irish in the homeland demanded that their transatlantic cousins in the US "unite with the abolitionists" although it fell on deaf ears. This began a pattern in which the Irish would compare their plight to other peoples, the Irish were slaves to Britain so it was only natural they support the freedom of black slaves, other peoples of the Empire had been conquered so it was only natural the Irish support their national ambitions alongside their own. This inevitably brought up the discussion of Jewish people and Zionism.
Zionism and Irish nationalism became linked when Michael Davitt, a member of the Irish Republican Brotherhood visited the city of Kishinev in 1903 after an anti-Jewish pogrom there and in his writings compared the Jewish and Irish questions with support for zionism. Davitt did at same time however make anti-semitic statements although he opposed a boycott of Jewish businesses in Limerick in 1904. The Kishinev pogrom and Davitt would both enter jewish folklore as key in the rise of early Zionism. In 1916 Yitzhak HaLevi Herzog, father of Chaim Herzog became the Rabbi of Belfast and later in 1919 became the Rabbi of Dublin. He spoke fluent Irish and was a strong supporter of Irish independence and the IRA, so much so he was dubbed the "Sinn Féin Rabbi" in the press.
Like many nationalist causes after the Irish of war of Independence Jewish groups adopted names and styles reminiscent of the IRA and frequently used their literature as a base for their own ideology. The zionist groups sought to compare themselves to the IRA and their successful campaign, in a fit of irony they would actually face many veterans of the war in Ireland as former Black and Tans and Auxiliaries were recruited in the local security forces for their expertise, who in turned faced old enemies as figures such as Yitzhak Shamir adopted nom de guerres of Irishmen, Yitzhak himself chose Michael after Michael Collins.
Relations however faltered in 1947 with the plan to partition Palestine into two states divided by religion, a reminder to Ireland's own partition 25 years earlier. The subsequent Arab-Israeli war put the final in the coffin of the Irish Nationalist/Zionist relationship, the expulsion of Arabs and warming up to Britain would see Israel be branded as a "Loyal Jewish Ulster" and a betrayer of both sides anti-imperialist roots. Hardline Irish republicans would strongly oppose Israel while the Irish government would not recognise Israel until 1963, blocking the idea of an Israeli embassy until 1993.
Opposing Israel became increasingly natural for the IRA and it's political wing Sinn Féin as time passed with Irish movement becoming increasingly left wing as opposed to Zionism rightward shift, supporting Palestine and the PLO as such became not just nationalist solidarity but also left wing solidarity between the movements.
I'm going to jump over the IRA dance with Marxism and split in 1969 as it's a huge topic in itself and instead focus on the PIRA/PLO relationship.
The PLO was most likely the second external terrorist group to establish relations with the PIRA after ETA (Basque Group) when the group emerged in 1969 but would quickly become an almost father like figure to the group. PLO bases were opened to PIRA volunteers and provided the training necessary to step up it's campaign and to evolve from a large formation insurgency to a smaller formation terrorist grouping, the PLO supplied arms alongside this training but they were not always accepted as the PIRA lacked smuggling routes through Europe at the time. The relationship while meant to be secret was increasingly reflected in Northern Ireland's famous murals and flag flying, murals supporting Palestine and reflecting IRA-PLO solidarity began to appear across the province and Palestinian flags were draped from lamposts in nationalist areas.
Throughout the 80s the relationship between the two organisations had begun to change, while the PLO could still provide safe bases for training the PIRA had begun to outstrip the PLO technologically and in many ways the dynamic shifted with Irish now training the Palestinians. This change would affect not only Palestine but the whole middle east as beginning in Iraq in the early 2000s PIRA developed bomb technology believed contained to Ulster would be used against coalition forces by Muslim extremists. The technology had likely travelled to Iran via Hezbollah during the PIRAs time in Lebanon or to Saddam's Iraq via Iraqi sponsored Palestinian factions.
The relationship began to drift as the PLO warmed up to the Irish government although the PIRA remained fully committed to the Palestinians, they began to play down the friendship in order to get recognition from the government, a plan that came to fruition when the PLO was allowed to open a delegation 1993 in Dublin, 2 weeks before the Israelis. The relationship became close again during the Second Intifada as Palestinian symbols appeared in greater numbers than ever before, and ever since pro-Palestine murals and flags are a constant in Irish nationalist areas.
This probably isn't a great answer, your question was sort of all over the place and really would have taken a book to fully explain, I'll give quick answers to the other parts though.
"Why is/was the IRA Marxist in ideology and how has that changed over time?"
The IRA was always affected by Marxism even reaching out to the Soviet Union in the 1920s but it remained a fringe faction until the early sixties when marxists took control of the Army Council and one was elected Chief of Staff. The marxists apparent pacifism and shift away from nationalism caused a split in the IRA in 1969 after the failures in the summer rioting. The 'Official' IRA stayed Marxist while the 'Provisional' IRA reverted to traditional ideas before adopting Democratic Socialism as it's politcal leaning.
"Did they work with Black September?"
Likely but hard to confirm, however they only "worked" together in the vein of training and technology transfer and wouldn't have been involved with operations, especially ones against civilians such as the Munich Massacre due to the PIRA's own aversion to targeting civilians as 'bad propaganda'.
"Did this relationship change after the Sabra and Shatila massacre?"
The massacre occured during a high point of PIRA-PLO relations and would have unlikely caused any shift except maybe cause the PIRA to avoid Lebanon as a training area.