Is it correct to use the preposition "by" interchangeably with "near"?
Solution 1:
Google gives 22 different prepositional usages for by, including
18: Indicating location of a physical object beside a place or object
and 5 prepositional usages for near, including
1: At or to a short distance away from (a place)
These two are the only cases where it's even feasible to use either - but even then they're not usually interchangeable. Partly because by normally means right next to, with nothing in between, whereas near simply means close to (where close may be a very subjective assessment).
In dialectal usages (Welsh sit by 'ere, the spiritual Kumbaya / come by here), most speakers would use nearby/near here (or perhaps over here, since it's about moving from there just as much as coming here).
Regarding OP's specific examples - I think the default is to use near. Idiomat/dialect favours by in some contexts, but normally only with very close proximity. And we don't normally use by to indicate proximity to anything "moveable" (such as a person). Idiomatically, we use pronouns such as me/him to mean my/his house, but it's still usually near me, not by me.
Nearby is more of an adjective/adverb than a preposition - it seems to have gradually evolved into its current "one-word" status over the past century. OP's example is non-standard - you can speak of a house nearby, or a nearby house, where nearby means near here (or near wherever is being spoken of). But we don't normally speak of a house nearby the shop.
Solution 2:
I voted to close this as something you can easily look up in dictionaries, but since it has received an incorrect response, I had better clear it up.
I went to the store near me.
This is OK grammatically. Note that there is some ambiguity. Literally, it means near your physical body (and there is some doubt as to whether that means where you are now, or where you were at the time you are talking about). Of course, your body doesn't stay in one place, so the shops "near" you will change as you move around.
In everyday speech, "near me" can be shorthand for "near my home" or "near my office", or school, etc. It's ambiguous, but not wrong.
I went to the store nearby me.
This not something you would normally hear. Nearby is not a preposition like "near" that can show the relationship between two nouns. It is an adjective.
You could use:
I went to a store nearby.
The sentence doesn't specify where the store is close to. The reader must infer that from context.
Or you could use:
I went to a nearby store.
... which has the same meaning, but places "nearby" in the conventional adjective position.
I went to the store by me.
This is OK grammatically - "me" is the object, the store is "by" you. If "I went to the store by the river" is syntactically correct, then so is "I went to the store by me".
However, it doesn't sound natural, because there are other set phrases that native speakers would always use instead.
"By myself" means "on my own". So:
I went to the store by myself
... means you had no company. It could reasonably be parsed as "I went to the store next to myself", but the familiarity of the phrase "by myself" trumps that.
All of this is irrelevant to the main question of whether "by" and "near" can be used interchangeably. They cannot, because they have different meanings.
10 Downing Street is near 14 Downing Street. But it is not by 14 Downing Street, because 12 Downing Street is between them.
12 Downing Street is both by and near 10 Downing Street.