Is the below definition correct?
Near is used for farer places than by.
a)We live near the sea(near is for 10~20km distance from the sea)
b)We live by the sea(a distance where you can see the sea, a quite close one)
1. The word is "farther", not "farer". A farer is one that fares.
2. I'd say that in your example your definition almost works. "By the sea" is very close to the sea. "Near the sea" is just close to the sea, probably farther than "by the sea", but not necessarily. I certainly wouldn't give any particular bounds to it though. It's relative.
3. We use spaces before opening brackets:
sea (near <-- correct
sea(near <-- incorrect