Mit is not a preposition, but an adverb here. See the Duden page for a detailed listing of several use cases.
I will answer your questions separately:
What role does mit play here?
I think the most important function of mit is to express togetherness:
Als Max einen Fallschirmsprung plant, meldet er Ernst gleich mit sich zusammen an.
However, you can think of mit also as a synonym for ebenfalls or auch here:
Als Max einen Fallschirmsprung plant, meldet er Ernst gleich ebenfalls an.
Als Max einen Fallschirmsprung plant, meldet er Ernst auch gleich an.
(As you see, auch would have a different position in the sentence, but I guess this needs to be discussed in another question.)
How would the infinitive of this phrase be? Jemanden mit anmelden?
This one is a bit difficult because mit can cross the line from adverb to verb prefix. The Duden article I linked above says that the adverbial mit (jmdn. (mit) anmelden ~ jmdn. (ebenfalls) anmelden) becomes a (separable) prefix (like in mitfühlen) when the connection is persistent. I think that doesn't explain all variations, but unfortunately, I haven't come up with a better criterium yet.
In this case, that means the infinite is (jmdn.) anmelden. But a verb like (jmdn.) mitanmelden is totally thinkable! With mit, it depends always on the context. In case of doubt, usually both perceptions are possible.
When "mit" is used as an adverb, it occupies a position right before the separable prefix, right?
At the time of writing I can't think of a counterexample, so I suppose it always does as a rule.
Would it be correct to remove the mit in the sentence and have it be correct? Such as Er meldet Ernst gleich an?
The sentence remains grammatical, but one important information is lost: Max plante einen Fallschirmsprung und meldete Ernst mit an implies that Max registered himself as well. This stems from the fact that anmelden can be interpreted as part of planen. Without mit, the sentence reads as if Max would register only Ernst or even plan the jump for Ernst.