So if 2 players are playing or only ones left in a game, if I goad my opponents creature it has to attack if able, let's say it can, and it attacks another player if able if I'm the only other player I will get attacked by that creature because there is no other player it can attack, it would it just not be able to attack bc it can't attack another player? Or if there was 3 players 1 goad opponent a and opponent b has a ghostly prison and decides not to pay 2 would it not attack at all or would it attack me?
"If the creature can't attack a player other than you, then it must attack you or a planeswalker if it can. This is most likely when the game is down to two players. And keep in mind that a goaded creature remains goaded until your next turn. So if another player gains control of it before then, it attacks under the same conditions if able."
As a rule, can't beats must. So the goaded creature can't attack if the player controlling it doesn't pay for ghostly prison.
To be clear, that creature will still need to attack if able. Since it can't attack the player with Ghostly Prison (unless they pay the cost which they are not forced to do) it will still need to attack a player if it can. Since the Ghostly Prison player is out, the only player left is the one who Goaded the creature. Unless something else is stopping it from attacking that player too of course.