Here are steps to add your friends in Pokémon X/Y
1) You need to add the friend on your 3DS home screen, not in game
2) On the top of your 3DS’s home menu screen, you’ll see a box with a smiley face in the middle. Click it.
3) Run through set up if needed
4) You can add friends here by exchanging friend codes. On the top of the screen, you’ll see that box with a plus on it. Click that.
5) Choose how to add friend. For this, we’ll select “internet”.
6) Add your friend’s friend code (your own friend code can be found on the previous page) and give them a nickname.
7) Tell your friend they need to add you back. Give them your friend code to add
8) Once this is done, you’re friends on the 3DS and also on Pokemon. Connect to the internet while playing X or Y and you’ll see your friends listed! Battle them and have fun!