Let $X$ be the subspace of $\mathbb{R}^n$ given by $$x_1^2 + \cdots + x_p^2 - x_{p+1}^2 - \cdots - x_n^2 = 1$$ I have to show that $X$ is homotopy equivalent to $S^{p-1}$.
Now, one is the obvious map, that is the inclusion map $$i: S^{p-1} \hookrightarrow X$$ I'm unable to think of an $f: X \rightarrow S^{p-1}$ that would work. I have a hint that says I should think of increasing $x_1, \cdots,x_p$ while decreasing $x_{p+1},\cdots,x_n$ and keeping $x_1^2 + \cdots + x_p^2 - x_{p+1}^2 - \cdots - x_n^2 = 1$ fixed. But I'm not sure what that means
I've been thinking about it more and more, and thought I should look how this works in $n=2$. So $X$ is nothing but the space given by the hyperbola $x^2 - y^2 = 1$
And now, I have to show that $X$ is homotopic to $S^0=\{(1,0),(-1,0)\}$
So, we're looking for a map $f:X \rightarrow \{(1,0),(-1,0)\}$. So, in $X$ we have basically 2 strands, one passing through $(1,0)$ and the other through $(-1,0)$. If I just project them on the points they pass through we will have the map $f(x,y)= \begin{cases}(1,0) & x>0 \\ (-1,0) & x<0 \end{cases}$
And, we had the inclusion map $i: S^0 \hookrightarrow X$
So, $f \circ i = \text{id}_{S^0}$; and $i \circ f = f$
Hence, we need to see if $f$ is homotopic to $\text{id}_{X}$. So, let's look at $H(x,t)=tx + (1-t)f$, which gives us what we need.
Are my arguments correct, and how do I generalise them?
Thanks to cjackal and Robert Ball I finally figured out, I thought it would be appropriate to post an answer.
We first let $\mathbf{x}=(x_1, \cdots, x_p)$, $\mathbf{y}=(x_{p+1}, \cdots,x_n)$, and $P(\mathbf{x,y}):\left\lVert\mathbf{x}\right\rVert^2 - \left\lVert\mathbf{y}\right\rVert^2$
Therefore, we have $X=\{(\mathbf{x,y}) \ \vert \ P(\mathbf{x,y})=1\}$
Now, we have our usual inclusion map $i: S^{p-1} \hookrightarrow X$. And we define $$f: X \rightarrow S^{p-1} \\(\mathbf{x,y}) \mapsto \left(\mathbf{\frac{x}{\left\lVert\mathbf{x}\right\rVert},0}\right)$$ We note that $f \circ i = \text{id}_{S^{p-1}}$, and that $i \circ f = f$. Therefore, we now want a deformation retract $$H: X \times [0,1] \rightarrow X$$ $$H((\mathbf{x,y}),t) = (1-t) \cdot \text{id}_{X}(\mathbf{x,y}) + \lambda(t) \cdot f(\mathbf{x,y}) = \left(\left(1-t + \frac{\lambda(t)}{\left\lVert\mathbf{x}\right\rVert}\right)\mathbf{x},(1-t)\mathbf{y}\right) \in X$$ Therefore, we want $$1=\left(1-t + \frac{\lambda(t)}{\left\lVert\mathbf{x}\right\rVert}\right)^2\left\lVert\mathbf{x}\right\rVert^2 - (1-t)^2\left\lVert\mathbf{y}\right\rVert^2 \\ = \left((1-t)^2 + \frac{\lambda(t)^2}{\left\lVert\mathbf{x}\right\rVert^2} + \frac{2\lambda(t)(1-t)}{\left\lVert\mathbf{x}\right\rVert}\right)\left\lVert\mathbf{x}\right\rVert^2 -(1-t)^2(\left\lVert\mathbf{x}\right\rVert^2 - 1)$$ $$= \lambda(t)^2 + 2\lambda(t)(1-t)\left\lVert\mathbf{x}\right\rVert + (1-t)^2 \\ \implies \lambda(t)^2 + 2\lambda(t)(1-t)\left\lVert\mathbf{x}\right\rVert + t(t-2) = 0$$ Hence, taking $$\lambda(t) = - (1-t)\left\lVert\mathbf{x}\right\rVert + \sqrt{(1-t)^2\left\lVert\mathbf{x}\right\rVert^2 - t(t-2)}$$ we get $$H((\mathbf{x,y}),1)=\lambda(1) \cdot f = f,\ \ \ \ \ H((\mathbf{x,y}),0) = \text{id}_{X} + \lambda(0) \cdot f = \text{id}_{X}$$ which gives us $f \sim \text{id}_{X}$. Hence $X$ is homotopy equivalent to $S^{p-1}$.
The deformation retract we obtained is moreover a strong deformation retract, since on $S^{p-1}$ we get $\lambda(t)=t$ and therefore $H((\mathbf{x,0}),t) = (\mathbf{x,0})$, $\forall t \in [0,1]$