If Riku was supposed to be the original Keyblade Bearer then how did Sora get the Keyblade?
As stated before, Sora was the 'better man'.
At the time Sora received the Keyblade, his Heart was stronger while Riku's gave in to the Darkness.
Then Sora was based as the true Master in Hollow Bastion.
A fun fact about the Originality of Riku's Masterhood is hinted in BBS, showing that
The one to choose Riku was actually Terra.
It adds up then, seeing how the Keyblade simply chose the one it would've chosen, and not someone else.
How did Riku get the Keyblade of Darkness?
Riku never had a Keyblade of Darkness.
He had the KK which is generally affiliated with the Light, then the Keyblade made from the Princesses' Hearts.
Then he had his own which is affiliated with the Dawn.
Ansem was the one to form the Heart Unlocker, probably, using the 6 Princesses' Hearts as base to form a Keyblade which could unlock the missing 7th Heart - being Kairi's Heart inside Sora's body.
If he could use a keyblade after he used the Keyblade of Darkness then why doesn't he use a Keyblade after that?
Because he couldn't just yet.
The Heart Unlocker wasn't a real Keyblade, nor was it his own, even - it was formed from Hearts, and the one actually wielding it was Ansem
, seeing how at this point in the game he had taken over Riku's Body.
The only other Keyblade he had was now Sora's, so he was left Keybladeless.