Let $G$ be a connected, planar, quartic graph and suppose we found a map $f$ and eulerian circuit as described in the question.
Since the degree of each vertex is four, then in the Eulerian circuit, each vertex $v$ must be included exactly twice in the sequence of nodes corresponding to the Eulerian circuit, say at index $i$ and $j$. Notice if the parity of $i$ and $j$ differ, then our map no longer has its alternating property (since $f(n_i) = f(n_j)$ and the difference between $i$ and $j$ is odd). Thus, it must be the case that the parity of $i$ and $j$ is the same and we can assign this parity to vertex $v$. If the parity is even, we'll say that $v$ is even-indexed, if it is odd, we'll say $v$ is odd-indexed.
This partitions the vertices of $G$ into even-indexed and odd-indexed vertices. Notice that due to the construction of Eulerian circuit, if we have an even number of vertices, then even-indexed vertices are only adjacent to odd-indexed vertices and odd-indexed vertices are only adjacent to even-indexed vertices and thus $G$ is in fact bipartite where each partition contains equal amounts of vertices (i.e. $G$ is a balanced bipartite graph).
If the number of vertices is odd, then we have something close to a bipartite graph with an added edge within one of the partitions. I would assume that you want you would want the alternating property of $f$ to also "loop back" in a sense though, i.e., $f(n_m) \neq f(n_1)$. This can only happen if the number of vertices is even, so we can throw out the case of an odd number of vertices if we want the alternating to loop back.
It's not too computationally taxing to determine if a graph is bipartite and to find the two partitions. If we are trying to find a Eulerian circuit and a mapping $f$ for $G$, we can simply test for bipartiteness and find the partitions. If the graph is not bipartite, we know that no circuit and mapping exist. If $G$ is bipartite, it suffices to pick any Eulerian circuit and map the vertices in one partition to $0$ and map the vertices in the other partition to $1$.