Show that the only invariant is the spectrum Recall that the symplectic group $$Sp_2(\mathbb{R}):= \{A\in SL_2(\mathbb{R}):A^TJA=J\}, \ \
   J=
  \left[ {\begin{array}{cc}
   0 & 1 \\
  -1 & 0 \\
  \end{array} } \right]
\ $$ 
We have its Lie-algebra $\mathfrak{sp}_2(\mathbb{R}):=\{\zeta :Tr(\zeta)=0\}.$ 
Consider the action by conjugation: $$Sp_2(\mathbb{R}) \times \mathfrak{sp}_2(\mathbb{R}) \to  \mathfrak{sp}_2(\mathbb{R}), \ (g,A)\mapsto gAg^{-1}.$$
I need to show that

The spectrum of $\zeta$ is essentially the only invariant of this action.

The way I understood this was to show that if $f:\mathfrak{sp}_2(\mathbb{R}) \to \mathbb{R}$ is a function satisfying $$f(gAg^{-1})=f(A),$$ then either $f$ is a trace function or determinant function. Is this correct way to rephrase my question. If yes, how should I go about proving the claim? 
I look forward for suggestions!
 A: First of all, observe that $\textrm{Sp}_2(\mathbb{R})=\textrm{SL}(2,\mathbb{R})$.  The symplectic group differs from the special linear group only in dimension $4$ and up.  Similarly for the Lie algebra.  This will simplify your computation enormously.
Secondly, since you just have $2\times 2$ matrices of zero trace (and at most two distinct eigenvalues), I believe the fastest way to prove your claim is to pick any two matrices $A,B$ with the same spectrum and show that there is a matrix $g$ with real entries of determinant $1$ such that $gAg^{-1}=B$.  
This is not hard because 1) trace zero and 2) at most two distinct eigenvalues means you have few computations to do:  your general matrix is $$M=\begin{bmatrix}a & b\\c & -a\end{bmatrix}$$ with arbitrary $\lambda$.  A representative of matrices with distinct eigenvalues $\lambda\neq -\lambda$ is $$\begin{bmatrix}\lambda & 0\\0 & -\lambda\end{bmatrix}$$ and one with equal eigenvalues is  $$\begin{bmatrix}0& 1\\0 & 0\end{bmatrix}.$$  Can you find $g$ that conjugates your $M$ to one of these classes?  It is just four equations to solve.  Then transitivity of the equivalence under conjugation will finish the problem.
Edit: I forgot the purely imaginary eigenvalues, since we are taking real matrices.  You have a third representative for the matrices of purely imaginary eigenvalues $\pm i\lambda$: $$\begin{bmatrix}0 & \lambda \\ -\lambda & 0\end{bmatrix}.$$  Now you can finish mapping everything to one of these three classes of representatives and you will be done.
A: Well, what about $f$ being the trace plus the determinant?  Or any symmetric function applied to its two eigenvalues?
Probably what's better to do is think about whether you can diagonalize the matrices by conjugating them.  Remember that conjugating a matrix by another matrix is the same as writing a linear operator in a different basis.
