So I've been interested in computing homotopy classes of maps $T^2=S^1\times S^1$ to $\mathbb{R}\mathbb{P}^2$. So first, we can decompose $T^2$ into a cell complex with one zero cell, $S^1\vee S^1$ and a disc $D^2$ glued down to $S^1\vee S^1$ using the commutator. Since the commutator vanishes in $\pi_1(\mathbb{R}\mathbb{P}^2)$ given any map $S^1\vee S^1\rightarrow \mathbb{R}\mathbb{P}^2$, one can extend this to a map $T^2\rightarrow \mathbb{R}\mathbb{P}^2$ by the map $D^2\rightarrow T^2$, but since the gluing map is nullhomotopic, this is the same thing as a map $S^2\rightarrow \mathbb{R}\mathbb{P}^2$ and there are $\mathbb{Z}$ homotopy classes of maps like this. Therefore we can write (as a set) $[T^2,\mathbb{R}\mathbb{P}^2] = \{a,b,c,d\}\times \mathbb{Z}$ where each of the $\{a,b,c,d\}$ is a homotopy class $S^1\vee S^1\rightarrow \mathbb{R}\mathbb{P}^2$. My question is given an arbitrary map $f:T^2\rightarrow \mathbb{R}\mathbb{P}^2$ is there some sort of computation we can do in $\mathbb{R}\mathbb{P}^2$ to determine which homotopy class $f$ belongs to or at least which of the $a,b,c,d$ it belongs to?
[Math] Determining homotopy classes [T^2, RP^2]
at.algebraic-topologygt.geometric-topology
Related Solutions
I looked at my homotopy theory lecture notes and we had the following similar result: $X$ H-CoGroup, $Y$ $H$-Group, then both group structures defined on [X,Y] agree. The proof goes roughly as follows: Call the upper products $\cdot$, resp. $*$. Inserting the definitions of those products, one can show the following "distributivity":
$(a\cdot b)*(c\cdot d)=(a * c)\cdot(b * d)$
Then one shows that both products have the same neutral element and finally
$f*g=(f\cdot 1) * (1\cdot g)=(f * 1)\cdot(1 * g)=f\cdot g$,
gives the result. That's the strategy of the proof in the case of $H$-(co-)groups.
We have that $S^3 \simeq \Omega \mathbb{H}P^{\infty}$, so by adjointness we can as well consider the group of maps $[\Sigma S^3 \times S^3, \mathbb{H}P^{\infty}]$. It is well-known that $[X,\Omega Y] \simeq [\Sigma X, Y]$ are isomorphic as groups, when you define the group structure on the first one by loop composition and on the second one by the pinching map/"cogroup structure" $\Sigma X \rightarrow \Sigma X \wedge \Sigma X$.
Now it can be proved (for example in Hatcher, section 4.I), that $\Sigma (S^3 \times S^3) \simeq S^4 \vee S^4 \vee S^7$.
This suggests $$ [S^3 \times S^3, S^3] \simeq [S^4, \mathbb{H}P^{\infty}] \times [S^4, \mathbb{H}P^{\infty}] \times [S^7, \mathbb{H}P^{\infty}] \simeq \mathbb{Z}\times \mathbb{Z}\times \mathbb{Z}/12 $$
but only as sets! This is because the splitting above is unnatural: There is a cofiber sequence $$ \Sigma (S^3 \vee S^3) \rightarrow \Sigma (S^3\times S^3) \rightarrow \Sigma (S^3\wedge S^3) $$ and this has a retraction, though not a very natural one, and apparently this cannot be retracted by a cogroup homomorphism. However, the splittability of this thing gives you already a short exact sequence $$ 0 \rightarrow \pi_6(S^3) \rightarrow [S^3\times S^3,S^3] \rightarrow \pi_3(S^3)\times \pi_3(S^3) \rightarrow 0 $$ by translating back via adjointness.
The splitting is obtained in the following way: More precisely, you can take the projections $\Sigma(S^3\times S^3) \xrightarrow{\Sigma p_k}\Sigma S^3$ for $k=1,2$ as well as the quotient map $\Sigma (S^3\times S^3) \xrightarrow{\Sigma \pi} \Sigma (S^3\wedge S^3)$ and add them together to obtain a homotopy equivalence $$\Sigma(S^3\times S^3) \rightarrow \Sigma S^3 \vee \Sigma S^3 \vee \Sigma (S^3\wedge S^3) $$ Now each of those is a nice cogroup homomorphism, but adding them together gives no cogroup homomorphism anymore since addition is not commutative here.
This gives a bijection $$ \pi_4(\mathbb{H}P^{\infty}) \times \pi_4(\mathbb{H}P^{\infty}) \times \pi_7(\mathbb{H}P^{\infty})\rightarrow [\Sigma S^3 \times S^3, \mathbb{H}P^{\infty}] $$ given explicitly by $(\alpha,\beta,\gamma) \mapsto (\alpha \circ \Sigma p_1)\bullet( \beta \circ \Sigma p_2)\bullet (\gamma \circ \Sigma \pi) $.
This in turn translates to a bijection $$ \pi_3(S^3) \times \pi_3(S^3) \times \pi_6(S^3) \rightarrow [S^3\times S^3, S^3] $$ given explicitly by $(\alpha, \beta, \gamma) \mapsto (\alpha \circ p_1)\bullet(\beta\circ p_2)\bullet(\gamma\circ \pi)$.
In particular, since precomposition induces a group homomorphism, we only need to figure out the commutators of $p_1, p_2$ and $\nu' \circ \pi$, where $\nu'$ is a generator of $\pi_5(S_3)$.
In Hatcher's book project "spectral sequences in algebraic topology", he mentions on page 67 of the part about the Serre spectral sequence the following (sadly without proof or reference): A generator of $\pi_6(S^3)$ can be constructed by considering the commutator map $S^3 \times S^3 \rightarrow S^3$ sending $(x,y)\mapsto xyx^{-1}y^{-1}$. This is constant when restricted to the $3$-skeleton, so it induces a map $S^3\wedge S^3 \rightarrow S^3$. According to him, this is a generator.
For us, this means that $[p_1,p_2] = \nu'\circ \pi$ (when we take $\nu'$ to be the map constructed above).
EDIT: I think we can obtain that $p_1,p_2$ commute with $\nu'\circ\pi$ as follows: Since there is an automorphism that exchanges $p_1$ and $p_2$ (given by flipping the factors of $S^3\times S^3$, it suffices to check this for $p_1$. Now $[p_1,\nu'\circ \pi] = [p_1,[p_1,p_2]]$ so we can write this as as the composition $$ S^3\times S^3 \xrightarrow{\Delta\times id} S^3 \times S^3 \times S^3 \xrightarrow{id\times [,]} S^3\times S^3 \xrightarrow{[,]} S^3 $$ However, since $[a,[b,c]] = 1$ whenever $a=1$ or $b=1$, the triple commutator $S^3\times S^3 \times S^3\rightarrow S^3$ factors through $(S^3\wedge S^3)\times S^3$. But since $\Delta: S^3 \rightarrow S^3\wedge S^3$ is homotopic to zero, the whole composition will be homotopic to zero now. More precisely, $[p_1,[p_1,p_2]] \simeq [1,[1,p_2]] = 1$.
This finally tells us: The extension $$ 0\rightarrow \pi_6(S^3) \rightarrow [S^3\times S^3, S^3] \rightarrow \pi_3(S^3) \times \pi_3(S^3) \rightarrow 0 $$
is central with $[p_1,p_2] = \nu'\circ \pi$.
Best Answer
The set of homotopy classes $[T^2,\mathbb{RP}^2]$ actually consists of the following:
The set $[S^1\vee S^1,\mathbb{RP}^2]$ consists of four elements, which I'll call $(1,1)$, $(-1,1)$, $(1,-1)$ and $(-1,-1)$. The notation refers to which element in $\pi_1(\mathbb{RP}^2)$ each $S^1$ maps to.
The homotopy classes $[T^2,\mathbb{RP}^2]$ which restrict to $(1,1)$ are indeed in one-to-one correspondence with the integers if you are looking at based homotopy and the natural numbers if you are looking at free homotopy.
The classes which restrict to $(-1,1)$, $(1,-1)$ and $(-1,-1)$ fall into only two distinct homotopy classes, corresponding to even/odd parity of the degree of that map $S^2\rightarrow \mathbb{RP}^2$ that you mentioned. You get the same count for both free and based homotopy here.
This is essentially worked out in a paper of Klaus Jänich. This paper of Bechtluft-Sachs and Hien uses the "Whitehead sequence" to calculate this as well.
There is however a hands-on way to see this:
The following Pontryagin-Thom type construction is a "computation in $T^2$" rather than in $\mathbb{RP}^2$ as you asked for but I hope it may help shed some light on these maps. These ideas are also very related to Ryan's last paragraph in his answer. A version of this written up for a physics audience is in section 2.3 of my thesis.
Recall that the Pontryagin-Thom construction give us bijections between the homotopy classes of maps from a manifold into another space and bordism classes of framed submanifolds. Most people who are familiar with this are familiar with the case of maps into spheres, but there are versions which work for maps into other spaces as well. In particular, since $\mathbb{RP}^2$ is the one-point compactification of a real line bundle (the Mobius strip), just as $S^n$ is the one-point compactification of $\mathbb{R}^n$ viewed as a bundle over a point, we get something relatively pretty here.
Given $f:T^2\rightarrow\mathbb{RP}^2$, we consider the inverse image of a copy of $\mathbb{RP}^1$ in $\mathbb{RP}^2$. For instance, a geometrical interpretation of $f$ is as an assignment of a line in $\mathbb{R}^3$ to each point on the torus; then we consider the locus of points on the torus such that the line field has no $z$-component.
Generically, "$f^{-1}(\mathbb{RP}^1)$" (abusing notation) is a set of curves on the torus (this is where the business of transversality comes into play). Furthermore, these curves carry maps to $\mathbb{RP}^1$ induced by $f$. I like to visualize this map by a rainbow coloring on the curves, i.e. points on the torus mapping to the same point on $\mathbb{RP}^1$ are colored the same.
Here's a picture of $\mathbb{RP}^2$ with a copy of $\mathbb{RP}^1$ colored.
We also need to keep track of how $f$ maps the normal bundle of these curves into the Mobius strip (I mean here the real line bundle version of the Mobius strip, which arises here from being the normal bundle of $\mathbb{RP}^1$ in $\mathbb{RP}^2$). That is, $f$ also gives a "Mobius-framing" to these colored curves.
One way to do keep track of this pictorially on $T^2$ is to do the following. First choose some point on $\mathbb{RP}^1$, say the point which we have decided to color blue; the fiber of the Mobius strip bundle over this point is a copy of $\mathbb{R}$ and we choose one ray to be the "positive" ray. Now, on each colored curve on $T^2$, whenever you see the color blue, draw an arrow pointing towards the side of the curve which points in the positive direction.
In this picture, I show the Mobius-framed colored curves in $T^2$ (the rectangle has opposite sides identified, of course) corresponding to the inverse image of $\mathbb{RP}^1$ from a certain map $f$. Note that I am marking the "positive side" of the normal bundle of the curves with + signs.
These Mobius-framed colored curves should be considered up to bordism. In terms of the pictures I've been describing, this works out to saying that we can isotope the colored curves, homotope the colorings on the curves (i.e. the maps to $\mathbb{RP}^1$) as well as performing the two following local operations:
For instance, the colored curves I showed above are related by a bordism to the following:
A version of the Pontryagin-Thom construction thus yields that the bordism classes of Mobius-framed colored curves on $T^2$ are in one-to-one correspondence with the elements of $[T^2,\mathbb{RP}^2]$. My reference for this is the last chapter of tom Dieck's recent book Algebraic Topology.
It's quite late here so I'm going to leave the details of the classification on $T^2$ for you to play around with (there's also more in 2.3.1 of my thesis).
Apologies for cutting this off so abruptly, feel free to ask for clarification in the comments.