I proved that if $f:S^{n}\rightarrow S^n$ has no fixed points then $\mathrm{deg}(f)=(-1)^{n+1}$. I want to use this to show that If $X$ has $S^{2n}$ as universal covering space then $\pi_1(X)$ is trivial or $\mathbb{Z}/2\mathbb{Z}$.
My attempt:
Since $S^{2n} \rightarrow X$ is the universal covering space, it follows that the group of deck transformations $G$ is isomorphic to $\pi_1(X)$. If $\pi_1(X)$ is trivial we are done so suppose $\pi_1(X)$ is not.
Take two nontrivial element $id \neq f,g \in G$. Since $S^{2n}$ is path-connected, the deck transformation is determined by a single fiber so $f$ and $g$ cannot have any fixed points. Therefore, $\mathrm{deg}(f) = (-1)^{2n+1} = -1 = \mathrm{deg}(g)$. Thus, $$\mathrm{deg}(f \circ f) = \mathrm{deg}(f)^2 = 1$$ and $$\mathrm{deg} (g \circ f) = \mathrm{deg}(g) \mathrm{deg}(f) = 1$$ How do I rigorously assert that $G \cong \mathbb{Z}/2\mathbb{Z}$ from here?
I am confused because $\mathrm{deg}(g \circ f) = 1$ doesn't mean that $g \circ f = id$ right? If not, are the group of deck transformations defined up to homotopy and $g \circ f \simeq id$?
Not in general. This fails to be true for odd dimensional spheres or when dealing with non-Deck maps. But ultimately it is true in this case.
No, Deck transformations are not defined up to homotopy. These are concrete, special homeomorphisms together with function composition. You are right that $g\circ f\simeq id$ but this is not enough for us. In general, Deck transformations can be homotopic but not equal (and in such case they will correspond to different elements of $\pi_1(X)$). But of course not in our case.
You are very close. You just need a purely algebraic argument. In current situation $\mathrm{deg}:G\to\{-1,1\}$ is a group homomorphism. And so the condition "$\mathrm{deg}(f)=-1$ when $f\neq id$" means that the kernel of $\mathrm{deg}$ is trivial. And therefore $\mathrm{deg}$ is injective, which finally means that (up to isomorphism) $G$ has to be a subgroup of $\{-1,1\}$.