It has already been established that the gun Oswald used could not have been fired in quick succession at the speed it needed to be done to be the murder weapon. It also lacked the accuracy required to be certain of a hit that would be fatal.
These tests were carried out by expert marksmen.
A documentary, quite some time back, focussed on the grassy knoll and a car parking area, secluded, at the top of it. It was secluded enough and close enough to have fired the bullets to the FRONT of Kennedys head. They even found a photo and using, at the time, up to date technology, traced a shadowy figure at the top of the knoll at the time Kennedy was shot.
There is no doubt that Oswald, a decent marksman, fired his gun and he may even have hit Kennedy, but not the volume of shots. It wasn't possible. .
Whether he believed that he was the sole assassin or was aware that he was the decoy, we shall never know.
Who killed him? The Mafia? I don't see it. If it had come out that they had, the law enforcement agencies would have gone to war with them in a way they had not done since, well, Al Capone. Why kill him and then live under the prospect of being unable to do what you were doing before? Doesn't make sense.
Was it his own security services? Probably.