Does $[G:H]=|G/H|$ hold for infinite groups? I'm working on an unassessed course problem,

We have showed that $$\text{det}:\text{O}_n\rightarrow\{\pm1\}$$ is a surjective homomorphism. Use the First Isomorphism Theorem to deduce from this that $\text{SO}_n$ is a subgroup of index $2$ in $\text{O}_n$.

I've written
\begin{align}
& \text{det}:\text{O}_n\rightarrow\{\pm1\} \text{ is surjective} \\
\therefore \; & \text{im}(\text{det})=\{\pm1\}; \\[1em]
& \text{and }\text{ker(det)}=\text{SO}_n; \\[1em]
\therefore\;& \text{by FIT } \exists \text{ an isomorphism } \overline{\phi}:\text{O}_n/\text{SO}_n\rightarrow\{\pm1\} \\[1em]
\therefore \; & 2 = |\{\pm1\}| = |\text{O}_n/\text{SO}_n| \stackrel{?}{=} [\text{O}_n:\text{SO}_n].
\end{align}
Is the final $\stackrel{?}{=}$ true?
Edit: changed $[\text{O}_n:\text{O}_n/\text{SO}_n]$ to $[\text{O}_n:\text{SO}_n]$ in the final line.
 A: $[G:H]$ and $|G/H|$ are literally the same thing. In fact $[G:H]$ is defined as $|G/H|$, which is the cardinality of the quotient set $G/H$, which is the collection of all cosets. Note that I used the word "set", because $H$ does not have to be normal. And this is the reason, I believe, we use two separate notions. Because typically $G/H$ denotes the quotient group, i.e. implicitly assumes $H$ is normal. Also $[G:H]$ shows your intention better: I'm interested in the number of cosets only, regardless of what additional structure they may have.
However, in my opinion the "$[G:H]$" symbol is really redundant, and introduces confusion only. That's why I personally never use it.

Is the final $\stackrel{?}{=}$ true?

On both sides you have exactly the same thing, and so of course it is true. You just said $x=x$. The equality is redundant.

That being said, when infinte groups are taken into consideration, you have to be slightly more careful when dealing with $|G/H|$. For example one formulation of Lagrange's theorem is:
$$|G/H|=|G|/|H|$$
which is nice to write, because we can clearly see that we can enter with $/$ under $|\cdot |$. This formula however is meaningless if $G$ is infinite, division is not well defined for infinite cardinals. And therefore the correct Lagrange's theorem is:
$$|G/H|\cdot |H|=|G|$$
which now is correct (because multiplication is well defined for cardinals, unlike division) regardless of whether we are dealing with finite or infinite groups. These are subtleties of cardinals though, still I thought it s worth mentioning.
