Riolu can be used in Little Cup, but other than that it can't really be used at all competitively. Here is a moveset you can use for Riolu if you're playing in Little Cup:
Riolu @ Eviolite
EVs: 196 HP / 196 Def / 116 SpD
- Drain Punch
For other movesets click the link below:
What is a good Little Cup moveset for Riolu?
In Gen 5 though Riolu could be effectively used as part of the Roar/Copycat/Prankster strategy, however in Generation VI Copycat will no longer receive increased priority if a Pokémon with the Ability Prankster uses a move with decreased priority, so essentially this strategy doesn't work anymore in Generation VI onwards.
If this is in game though, then Riolu would be fine to use as you can pretty much complete the game with any Pokémon.
If you want though you can always evolve Riolu into a Lucario, Lucario is without a shadow of a doubt a good Pokemon to use competitively. Normal Lucario is currently ranked in UU by Smogon, while it's Mega Evolution Mega Lucario is in Uber's (it's that OP).