Let $f : \Bbb S^2 \rightarrow \Bbb RP^2$ and $g : \Bbb RP^2 \rightarrow \Bbb S^2$ be continuous maps between sphere and projective plane.
Show that $g \circ f :\Bbb S^2 \rightarrow \Bbb S^2$ is not homotopic to the identity map.
Should I start with the fundamental group of $\Bbb RP^2$ isomorphic to $\Bbb Z_2$?
Using algebraic invariants is definitely the way to go about this. However, in this particular case, the fundamental group may not be the right algebraic invariant.
Let me first illustrate the kind of argument you can give, by using the fundamental group to show that $fg: \mathbb{R}P^2 \to \mathbb{R}P^2$ cannot be homotopic to the identity map. This is of course not the function composition you asked about, but the argument for $fg$ is similar (I'll come back to that in a bit).
Let us collect a few necessary facts: $\pi_1(\mathbb{S}^2) = 0$ and $\pi_1(\mathbb{R}P^2) = \mathbb{Z}/2\mathbb{Z}$. Any continuous map $h: X \to Y$ induces a homomorphism $h_*: \pi_1(X) \to \pi_1(Y)$ of fundamental groups, homotopic maps induce the same homomorphism and this is functorial: it respects function composition (so $(h h')_* = h_* h'_*$) and sends the identity to the identity.
Suppose that $fg$ is homotopic to the identity, and aim for a contradiction. We must have that $(fg)_* = f_* g_*$ is the identity, but then the identity on $\mathbb{Z} / 2\mathbb{Z}$ factors through the trivial group 0, which is impossible. More precisely: $f_* g_* = Id$ means that $g_*$ is injective, but $g_*$ is a map from $\mathbb{Z}/2\mathbb{Z}$ to $0$. So $g_*$ cannot be injective, which gives us our contradiction.
This argument does not work for the composition $gf$, because $g_* f_*$ is a map from the trivial group $0$ to itself, and there is no problem with this factoring through any other group. However, there are other algebraic invariants. The first that pops into the mind is singular homology, so you may want to try that (and yes, this will work). I will leave it to you to adjust the argument to use singular homology.