Does the video card RX580 support the Samsung Odyssey G9 monitor in windows 5120x1440 240Hz mode ?
Depends, Sapphire RX580 specs from CNET : https://www.cnet.com/products/sapphire-nitro-plus-rx-580-graphics-card-radeon-rx-580-8-gb/
Yet the Asus RX580 does have a higher resolution but doesn't mention the Frequencies that are compatible from CNET: https://www.cnet.com/products/asus-rog-strix-rx580-8g-gaming-graphics-card-radeon-rx-580-8-gb-rogstr...
ASRock RX580 has the same Resolutions as Asus: http://www.asrock.com/Graphics-Card/AMD/Phantom%20Gaming%20D%20Radeon%20RX580%208G%20OC/#Specificati...
So it seems it does support 5K but probably not at 240 Hz. Most likely at 60 or less Hz.
Best thing to do is open a Support ticket with the manufacturer of your RX580 and ask them directly.