[EDIT: I've tightened my wording and added a couple of references which I went back to out of curiosity.]
Will's answer has the elements needed for a concrete reply to the question, but the question itself has caused some confusion about the setting and terminology which are worth clarifying. First of all, the underlying field should be of characteristic different from 2, since it gets more subtle to talk about quadratic forms and orthogonal groups in characteristic 2. (This is done however in work of Chevalley and Borel in the algebraic groups framework, where the groups are included in the classification.)
Originally the study of orthogonal groups as Lie groups was carried out (byby Weyl, Chevalley, and many others) only in characteristic 0. Here the (polynomial) condition on $n \times n$ matrices is just that the transpose of a matrix must equal its inverse. The orthogonal matrices then form a group, say with the naturalcompact real Lie group $\mathrm{O}(n)$ or a noncompact complex topology. Orthogonal matrices have eigenvalues in these cases which are of absolute value 1, paired with their inversesLie group (or complex conjugates), allowing determinant$\mathrm{O}(n, \mathbb{C})$ of dimension $\pm 1$$n(n-1)/2$. Thus the real or complex orthogonal group will have at least two connected components in In the usualeuclidean topology, considering the two cosets oflatter group is homeomorphic to the kernel of detformer group times a vector space. The real or complex dimension So connectedness questions can be settled in the compact case.
Since eigenvalues of this Lie group is easily computedan orthogonal matrix occur along with their inverses, (say for$\det=\pm 1$ and matrices of det $n$ odd) to be$-1$ form a closed normal subgroup $2\ell^2+\ell$$\mathrm{SO}(n)$ or (in$\mathrm{SO}(n, \mathbb{C})$ giving in Lie theory terms,the rank $\ell$ andseries: $\ell^2$ positive roots)$B_\ell$ with $n=2\ell+1$ odd, $D_\ell$ with $n=2\ell$ even. It's worth following the case $n=5$ in Will's calculations: Lie type $B_2$.
The special orthogonal group is the kernel of det here and is usually just called $\mathrm{SO}(n)$ or the like when the field is understood. To show itthat the compact group is connected in the topological group setting, Chevalley in Theory of Lie Groups uses induction on $n$ and the characterization of the successive quotients as spheres.
Now in the Chevalley-Borel setting of linear algebraic groups (first overover an algebraically closed field $K$), not yet expressed in terms of group schemes, much of the previous study carries over with modifications. For linear algebraic groups given the Zariski topology, irreducibility of the underlying variety fortunately coincides with connectedness in that coarse topology; the term "connected" is then preferred. The irreducible (= connected) components of an algebraic group $G$ are disjoint and equidimensional as well as finite in number (unlike some Lie groups): these are just the cosets of the identity component $G^\circ$. We denote the points of the group over $K$ as $\mathrm{SO}_n(K)$, but the scheme language probably adds nothing useful to the study of connectedness here.
Here theThe most general argument for connectedness of anstandard elementary way to show that a linear algebraic group requires itis connected is to beshow that it is generated by suitable irreducible subsets such as closed
connected connected subgroups. In For the framework of classical matrix groups, this is most easilyusually done by generatingshowing that the group is generated by transvections, hence by connected 1-dimensional unipotent groups. With some care this approach even handles special orthogonal groups in characteristic 2.
On the other hand, there is the possibility discussed in this question here raises the possibility of appealing (in characteristic not 2) to a Cayley transform. Here one is able to map isomorphically a nonempty open subset of an affine space (dense in the Zariski topology) onto a nonempty open subset of the matrix group in a concrete way. Then Then it has to be seen, as Will shows, that in the specific situation of the special orthogonal group none of itsthe hypothetical extra irreducible/connected components of $\mathrm{SO}_n(K)$ can lie in the excluded hypersurface given by nonvanishing of a determinant. Dimension counting seems necessary here.
The only source I can quote for this slightly esoteric approach is a terse exercise 2.2.2(2) in Springer's book Linear Algebraic Groups, where much is left to the reader's ingenuity. (Are there earlier sources?) Springer himself was attracted to this approach, I think, because he used the Cayley transform for classical groups to realize an isomorphism between unipotent and nilpotent varieties in the group and its Lie algebra.
Earlier arguments appear in at least two places. [Note in each case that for the standard structure theory (over an arbitrary field) involving an isotropic split torus in diagonal form, orthogonal groups are written as matrices using an orthogonal direct sum of hyperbolic planes; over $K$ this translates to the conventional format above.]
Chevalley's 1956-58 seminar Classification des groupes algebriques semi-simples (typeset text, Springer 2005, edited by Cartier). In Expose 22, Chevalley gives an argument for connectedness of some of the linear groups roughly analogous to the inductive argument for compact Lie groups.
The second edition of Borel's original notes Linear Algebraic Groups (Springer GTM 126, 1991). In the added Section 23 he discusses examples involving groups of rational points of various classical groups, observing in particulqr that over $K$ the relevant groups are Zariski-connected. (Characteristic 2 requires as usual extra discussion, as does type $D_\ell$.) Here the arghument relies on the standard structure theory, showing in effect that a hypothetical coset representative for $G/G^\circ$ must in fact represent an element of the Weyl group and thus lie in $G^\circ$.