Let $M^n$ be a closed manifold (I think we can also assume it is connected, though it isn't explicitly stated). Let $f:M^n \to \mathbb{R}P^n$ be a smooth map, and let be $a \in \mathbb{R}P^n$ be a regular value of $f.$ Then, since both manifolds have the same dimension, by the inverse mapping theorem $f$ is a local diffeomorphism near each $x \in f^{-1}(a),$ and so $f^{-1}(a)$ is discrete (hence finite by compactness of $M$).
I want to show the following: If $\pi_1(f)$ is the zero map, then $f^{-1}(a)$ has an even number of points.
I've been thinking about this for a while, but I don't see the idea behind the proof yet. The cases $n=1$ and $n \geq 2$ seem quite different: when $n=1$ then we're really looking at maps $f:S^1 \to S^1$ of degree zero; intuitively such a loop needs to pass through a regular point an even number of times in order to end at its starting point. For the case $n \geq 2$ we have $\pi_1(\mathbb{R}P^n) = \mathbb{Z}/2.$
Since $\pi(f) = 0,$ by the lifting theorem we know that there exists a lift $g:M \to S^n$ of $f$ (i.e. $f = p \circ g$ where $p:S^n \to \mathbb{R}P^n$ is the canonical map). So it seems like the "evenness" of points in $f^{-1}(a)$ should come from the antipodal action on $S^n$ somehow.
I'd be glad if someone could give me a hint in the right direction.
Here's another argument: Every regular value $a \in \mathbb{R}P^n$ of $f$ corresponds to a pair of regular values $b,-b \in S^n$ of the lift $g: M^n \to S^n$, and $$|f^{-1}(a)|=|g^{-1}(b)|+|g^{-1}(-b)|.$$ Since the mod-2 degree of a smooth map is given by the cardinality (modulo 2) of the preimage of any regular value, we have $$|f^{-1}(a)| = |g^{-1}(b)|+|g^{-1}(-b)| \equiv 2\deg_2(g) \equiv 0 \quad \operatorname{mod} 2. $$