Solution 1:

I'm not sure about how to prove that "near" is the head of "near here." However, I don't find the argument that "near" is an adverb in "very near here" very convincing, for the reasons listed below, so I would default to assuming it is the head because

  • prepositions and adjectives precede their complements by default
  • "near" certainly precedes its complement when the complement is an NP such as "my house." There are examples of parallelism with "near here" coordinated with "near [NP]": although these don't prove anything about the structure of "near here", I think they are weak evidence for it sharing some structure with "near [NP]."

    If your hotel is near here or near the train station, you can get there on foot. (Rick Steves Italy 2017)

"very near" seems to be possible even when "near" is definitely not an adverb

They live near here.

If you call near in this sentence an adverb modifying "here," what would you say about sentences like the following?

They live near my house.

While it seems (I'm looking at an old question of yours, Adverbs modifying nouns?) that adverbs can modify NPs in some circumstances, I don't think that's what's happening here because if "near" were an adverb, I would expect it to be an adjunct and therefore optional in this construction. But "near" is actually necessary for the construction to be grammatical; we can't say

*They live my house.

So it seems to me that "near" is in fact the head of the complement of "live" here, and "my house" is the complement of "near."

We could hypothesize that "near" can be used in two ways, as a head and as an adverbial adjunct, but that doesn't resolve the problematic use of "very near" that you identified because we can say

They live very near my house.

I think this example, along with the previous ones, shows that we have to say that "very" can modify "near" even when "near" is functioning as a head, not as an adverb.

Maybe "near" is a weird (gradable) preposition

There is other evidence showing that it is not entirely impossible for a prepositional phrase to be modified by "very." Maybe "near" is just a weird preposition that licenses the use of "very" to modify prepositional phrases of which it is the head (as tchrist says, a "gradable preposition").

We can say things like "very out of place/very out of fashion." I found an article "The Language Mavens," by Steven Pinker, that provides another example that I think is similar and some discussion:

Safire then goes on to rebuke Streisand for "very in the moment":

This very calls attention to the use of a preposition or a noun as a modifier, as in "It's very in" or "It's very New York" or the ultimate fashion compliment, "It's very you." To be very in the moment (perhaps a variation of of the moment or up to the minute) appears to be a loose translation of the French au courant, variously translated as "up-to-date, fashionable, with-it"...

Once again, by patronizing Streisand's language, Safire has misanalyzed its form and its meaning. He has not noticed that:

  1. The word "very" is not connected to the preposition "in"; it's connected to the entire prepositional phrase "in the moment."

  2. Streisand is not using the intransitive "in," with its special sense of "fashionable"; she is using the conventional transitive "in," with a noun phrase object "the moment."

  3. Her use of a prepositional phrase as if it were an adjective to describe some mental or emotional state follows a common pattern in English: "under the weather," "out of character," "off the wall," "in the dumps," "out to lunch," "on the ball" and "out of mind."

(in The Workings of Language: From Prescriptions to Perspectives, edited by Rebecca S. Wheeler, accessed through Google Books)

Now, this is obviously not exactly the same usage as "live very near here." Pinker's examples of prepositional phrases that can be treated like adjectives would mainly appear in the same environment as adjectives: predicative or preposed attributive contexts, such as "He's very under the weather" or "A very out-of-character moment for him."

The verb "live" does not usually take an adjective phrase as its complement (although I think it is possible, as in "live free") and I can't find any examples searching the Google Ngram Viewer of "live very in *" or "live very out *" (although a Google search did turn up a few examples of "live very out of the way"). So, there does still seem to be something special about the behavior of prepositional phrases headed by "near." But, I think examples like the ones Pinker lists do show that prepositional phrases can be modified by "very" in at least some circumstances.

Maybe "near" is a transitive adjective

The other option that seems possible to me at the moment (grammarians have probably already thought about it and found reasons to reject it) is to consider "near" a "transitive adjective" in this context, like "worth." Near can certainly function as an adjective when it doesn't have a complement, so it doesn't seem so much of a stretch to suppose it could also be an adjective with a complement.

From reading "New transitive adjectives" (Pullum, Language Log), it looks to me like the CGEL argument against this analysis would be the existence of pied-piped constructions like "near which...," which are not possible with "worth."

Solution 2:

Please also see John Lawler’s answer regarding superlative prepositions. Mark Beadles also has an answer there quoting the OED regarding near as what Mark calls a “sneaky” adverb.

Near as a Gradable Preposition

One way to look at this is to think of near as a gradable preposition. Grading prepositions is rather uncommon but certainly possible, at least in speech:

Jim, could you please reset the clock above the door for me?

[time passes as the task is completed]

No, sorry, I meant the clock more above the door than the one you reset.

Prepositions are connecting little function words that describe the relation of their noun-phrase (NP) complement to other words in the sentence, most typically to another NP but sometimes also to a verb phrase (VP). The preposition together and its complement make up a prepositional phrase (PP).

These are all clearly prepositions because they are the connection between one NP (the clock) and another (the door):

  • the clock above the door
  • the clock by the door
  • the clock near the door

It just so happens that because of its origins as a modifier, near even as a preposition continues to enjoy the customary perquisite of modifiers in being subject both to other modifiers of degree and even to regular inflectional morphology:

  • He chose a seat near the door.
  • He chose a seat very near the door.
  • With just two seats in the room, he always prefers the one nearer the door.
  • He picked the seat nearest the door.

These are not adjectives the way the nearest door would be; they come before the entire NP to join it to something that came before it.

Other modifiers like close and far can’t stand alone as prepositions in their own right but instead need to be followed by another preposition to be used as a prepositional phrase:

  • the chair close to the door
  • the chair closer to the door
  • the chair far from the door
  • the chair farthest from the door

Although you can combine near with to in this way, you don’t need to, which is what makes it unusual as prepositions run in its gradability.

There are of course other possible analyses of what’s going on here, such has a hidden whiz-deletion. But thinking of near as a gradable preposition may be the simplest explanation.