I think to impress them. He was viewed as a no value loser to them generally. I think this was him trying to restore his ego because of their rejection.
I think this is the most likely scenario. They may have planted the idea in his head, but just to incite a nut case (probably one of many) and not as any sort if agent. Historically, most political assassins in the U.S. have been fringe nuts acting alone.
I think Oswald was like the nut case who shot Rep. Scalise while trying to assassinate all of the Republican Congressman at a baseball practice in 2017. He was a Bernie Sanders supporter who was clearly incited by left wing democrats, but was not acting under their direction.