Solution 1.
Let$$g: X \to S^n, \text{ }(p, q) \mapsto p.$$We see that $g \circ f = \text{Id}_{S^n}$. Now, let $(p, q) \in X$. There is a well-defined shortest path $\lambda_{p, q}: [0, 1] \to S^n$ starting at $p = \lambda_{p, q}(0)$ and ending at $q = \lambda_{p, q}(1)$, as $p \neq -q$. Define$$H : X \times [0, 1] \to X,\text{ }H(p, q, t) = (p, \lambda_{p, q}(t)).$$Then$$H(p, q, 0) = (p, p) = (f \circ g)(p, q),\text{ }H(p, q, 1) = (p, q) = \text{Id}_X(p, q).$$Moreover, it is easy to see that $H$ is continuous. (This is at least easy to give a handwaving argument for. Basic open sets in $X$ look like direct products of epsilon balls inside $S^n$. These have preimages under $H$ of direct products of epsilon balls in $X$, crossed with $[0, 1]$, which are of course open in the product topology.) Thus, $f \circ g$ is homotopic to $\text{Id}_X$. Hence, $f$ is a homotopy equivalence between $X$ and $S^n$.
Solution 2.
We show that $X$ is the tangent bundle of $S^n$. The way to see this is to visualize the tangent space at a point $p$ as a hyperplane $\mathbb{R}^{n+1}$ with origin at $p$ and then folding the plane over the second $S^n$ factor using stereographic projection. We see that the only points in $S^n \times S^n$ that we miss with this operation are the anti-diagonal points. Now, the zero section under this identification of $X$ with $TS^n$ is the diagonal. Hence, $X$ deformation retracts onto the diagonal. Since $f$ is an isomorphism of $S^n$ with the diagonal, it is a homotopy equivalence between $S^n$ and $X$.
Solution 3.
Here is a way to prove the result using extra machinery but without the topological visualization. Note that both the sphere and $X$ are CW-complexes, and hence, we just need to prove that $f$ induces isomorphisms on homotopy groups. In fact for $n > 1$. Now, using the same $\pi$, as before, it actually suffices to show that $\pi$ induces isomorphisms on homotopy groups. Now, $\pi$ already induces a surjection on homotopy groups, and thus, since the homotopy groups of the sphere are finitely generated, we only need to show that both the sphere and $X$ have the same homotopy groups. This can be done using the long exact sequence of a fibration. $\pi$ is a fibration with contractible fiber $\mathbb{R}^{n+1}$, and hence, the homotopy groups of $X$ are the same as the homotopy groups of the sphere.