Image of determinant on symplectic/orthogonal matrix group Let $\mathbb K$ be a field, $n\geq 1$, and $G=GL_n({\mathbb K})$ be the group of invertible $n \times n$ matrices with coefficients in $\mathbb K$. For $J\in G$, we can define (in analogy to orthogonal&symplectic matrix groups)
$$
H=\lbrace M \in G | {}^tMJM=J\rbrace
$$
This is a subgroup of $G$, and the determinant defines a homomorphism $H \to \lbrace -1,1\rbrace$ (because $({\sf det} M)^2=1$ for any $M\in H$, by taking determinants in the equation above). So the image of this homomorphism is either $\lbrace 1 \rbrace$ (trivial) or $\lbrace -1,1\rbrace$ (full).
In some cases (say $\mathbb K=\mathbb R$ and $J=I_n$ : then $H$ is the group of orthogonal matrices), the image is full (for example, ${\sf diag}(1,-1)$ has determinant $-1$).
In others (such as when $J$ is as in this  recent Math.stackexchange question), the image is trivial.
The (obvious) question is : for which $J$ is the image trivial or full ?
 A: Incomplete answer, but so far the only one proposed. This hands the symplectic case, but not the mixed case.
A variety of answers are given in this 2003 technical report by D. Steven Mackey and Niloufer Mackey. It gives proofs using structured decompositions, including using symplectic transvections (the proof I alluded to in comments), but also an older and relatively elementary but not well-known (to me) proof using the Pfaffian. Another elementary proof using more direct calculation for the specific J of interest is given in this blog post by Suresh Govindarajan.
Pfaffians for anti-symmetric matrices
An elementary proof can be given using a better determinant: the Pfaffian.  For a skew-symmetric matrix, $-J={}^tJ$, the Pfaffian is a scalar $p$ such that $p^2 = \det(J)$, and it transforms naturally under similarity transformations: $\newcommand{\Pfaffian}{\operatorname{Pf}}\Pfaffian( {}^tMJM ) = \det(M) \Pfaffian(J)$. The result now follows since $\Pfaffian( {}^tMJM ) = \Pfaffian( J ) \neq 0$, since $\Pfaffian(J)^2 = \det(J) \neq 0$ by hypothesis.
A useful identity for the Pfaffian that applies better to the $J$ mentioned in the other question is:$$\Pfaffian\left(\begin{smallmatrix} 0 & {}^tA \\ -A & 0 \end{smallmatrix}\right) = (-1)^{n(n-1)/2} \det(A)$$
so you can see the Pfaffian tries to factor the determinant of the whole matrix (which is $\det(A)^2$) in terms of one of its blocks.
It is not hard to see that if $-J={}^tJ$ then $n$ is even. In the odd case, one could still have a mixed $J$, neither symmetric nor anti-symmetric, and I would be very curious if the determinant is restricted to +1 only.
Odd-case is easy
If $J$ is any $(2n+1)\times(2n+1)$ matrix, then ${}^t M J M = J$ where $M=-I$ and $\det(M)=-1$. The key feature of (invertible) symplectic matrices is that they only exist in even dimensions. In odd dimensions we always get a full image of $\det$.
This still leaves the mixed case in even dimensions.
A: I'll assume $K$ is not of characteristic $2$.
If $M$ satisfies ${}^t\!MJM=J$ then, applying transposition to the equation, one also has ${}^t\!M\,{}^t\!JM={}^t\!J$. Therefore if we denote by $H_J$ the group defined by $J$, one easily checks that $H_J=H_{J_S}\cap H_{J_A}$ where $J_S=J+{}^t\!J$ is a symmetrization of $J$, and $J_A=J-{}^t\!J$ an anti-symmetrization. The answer can therefore be deduced from that for the cases where $J$ is symmetric (the orthogonal case) and where $J$ is anti-symmetric (the symplectic case). However $J$ is no longer necessarily invertible here, so one needs to consider the radical of the bilinear form defined by $J$ as well (if the radicals of $J_S$ and $J_A$ have a non-trivial intersection, it is not even ensured that $\det M=\pm1$, but this should not happen if the original $J$ is invertible).
[Added] One possible analysis is as follows. Whenever one can decompose the space into a direct sum that is othogonal for both the bilinear forms defined by $J_A$ and $J_S$, then one can define endomorphisms independently on the two factors. In paticular, if the intersections of the radicals of $J_A$ and $J_S$ is non-trivial, it will be orthogonal for both forms to any complementary subspace, so we can do anything we like on this intersection and the identity on the complementary factor, and thus see that any nonzero determinant can be achieved in this case. On the other hand, if the radical of $J_A$ is trivial, then we have a subgroup of the symplectic group defined by $J_A$, and only the determinant $1$ can be obtained. For the remaining case let $R$ be the radical of $J_A$ (so we have $\dim R>0$), and $C$ its orthogonal complement for the orthogonal form defined by $J_S$. It may be that $R$ and $C$ have a non-trivial intersection, which is the radical of the restriction of the orthogonal form to $R$; in that case, let $R'\subseteq R$ be a complementary subspace in $R$ of $R\cap C$, and $C'\supseteq C$ the orthogonal complement for $J_S$ of $R'$. Then one can check that the whole space is the direct sum of $R'$ and $C'$, orthogonal for both forms. Now if $\dim R'>0$, in other words if $C\not\subseteq R$, then one can choose an orthogonal transformation of $R'$ with determinant $-1$ and the identity on $C'$, showing that $-1$ occurs as determinant. In the remaining case $R$ is contained in $C$, both are stable subspaces for any $M$ under consideration, and the orthogonal form induces a duality between $R$ and $V/C$ so the determinant of $M$ is the one of the transformation of $C/R$ it induces. If the symplectic form induces a non-degenerate symplectic form in this subquotient (for instance when $R=C$) then $\det M=1$ always. If not we have a space $C/R$ that carries induced orthogonal and symplectic forms, the latter having a non-trivial radical; we are back in the initial situation but with a smaller dimension, so we can continue as above until reaching a decision as to whether $-1$ occurs as determinant or not.
A: Yet another incomplete answer…. Remark 1 : when $J$ can be written as two or more blocks, and at least one of those blocks has odd dimension, e.g.
$$J=\left(\begin{smallmatrix} A & 0 \\ 0 & B  \end{smallmatrix}\right) $$
where $A$ and $B$ are square $a\times a$ and $b \times b$ submatrices with $b$ odd, then we have an $M$ of determinant $-1$ : $M={\sf diag}(I_{a},-I_{b})$.
Remark 2 : The problem is invariant by congruence : if we put
$$
{\Gamma}_J=\lbrace M \in G | {}^tMJM=J\rbrace
$$,
then we have for any invertible $P$ the identity
$$
M \in {\Gamma}_{{}^tPJP} \Leftrightarrow P^{-1}MP \in {\Gamma}_{J}
$$
Unfortunately, while a basis of polynomial invariants is well known in the case of similar matrices (the  coefficients
of the characteristic polynomial), I do not know if such a basis is even known for the congruence relation.
This paper studies “normal forms” for the congruence relation.
