Actually, there is a part of the Friend Safari that requires an Internet connection. The Friend Safari can of course be used without it, but you won't have access to a rather significant feature.
As the others said, you will to register Friend Codes. One both players have each others' Friend Codes, they will appear on the Friend Safari. You can do this both via wireless or by the Internet (wireless if you want to exchange codes with someone nearby and Internet if you want to enter a code belonging to someone far away).
This will allow you to enter that player's safari. However, only two out of three will appear there if done this way; there is one final step that requires the Internet that will cause the third Pokemon to be available. Basically, it requires both players to have beaten the Elite Four and Champion. Then, if both players happen to be online at the same time, the third Pokemon in both players' safaris will be unlocked.
So if you want the third Pokemon, you will need to connect your 3DS to the Internet via Wi-Fi. Otherwise, you just need to exchange Friend Codes and you'll be set.