Why do $SO(n,\mathbb{R})$ and $O(n,\mathbb{R})$ have the same Lie algebra? If we define $O(n,\mathbb{R})=\{A\in GL(n,\mathbb{R}):A^tA=I\}$ and $SL(n,\mathbb{R})=\{A\in GL(n,\mathbb{R}):\det(A)=1\}$ then $SO(n,\mathbb{R})=SL(n,\mathbb{R})\cap O(n,\mathbb{R}).$
I know that the Lie Algebra of $O(n,\mathbb{R})$ comprises of skew-symmetric matrices and that the Lie Algebra of $SL(n,\mathbb{R})$ comprises of matrices with zero trace. I was guessing that the Lie Algebra of $SO(n,\mathbb{R})$ then should comprise of skew-symmetric matrices with zero trace. However, this is not the case.
Question 1: How do I show that the Lie algebra of $SO(n,\mathbb{R})$ is the same as the Lie Algebra of $O(n,\mathbb{R})?$
I also noticed that on the other hand the Lie Algebra of $SU(n,\mathbb{C})$ comprises exactly of the skew-Hermitian matrices with zero trace. I am guessing an answer to the first question should explain why this is true. Still I wonder
Question 2: Under what conditions do we have that $N=H\cap G$ implies $\mathfrak{n}=\mathfrak{h}\cap \mathfrak{g}$ where $N,H,G$ are Lie Groups and $\mathfrak{n},\mathfrak{h}$ and $\mathfrak{g}$ are their associated Lie Algebras?
 A: Consider a curve $\gamma:(-1,1)\to \mathbf{SO}(N)$ with $\gamma(0)=I$. By definition, it is such that $\gamma(t)^T \gamma(t)=I$ for all $t\in(-1,1)$. Differentiating with respect to $t$, and evaluating at $t=0$, we thus get
$$\gamma'(0)^T + \gamma'(0) = 0.$$
Observe now that nowhere in this reasoning we used the fact $\gamma(t)$ have unit determinant, and that the same exact reasoning will work for curves $\gamma:(-1,1)\to\mathbf O(N)$.
Notice also that any skew-symmetric real matrix has vanishing trace: if $A=-A^T$, then $A_{ii}=0$ for all $i$.
A: If one is willing to avoid all of the details regarding special types of matrices, there is a simple abstract reason that $O(n;\mathbb R)$ and $SO(n;\mathbb R)$ should have the same Lie algebra, namely that the Lie algebra is an invariant of the local group structure of a Lie group, and the Lie groups $O(n;\mathbb R)$ and $SO(n;\mathbb R)$ have isomorphic local group structures.
In more detail, suppose that $G$ is a Lie group and $U \subset G$ is any open neighborhood of the identity element $I \in G$. By restricting the group operation on $G$ to $U$ we obtain what I'll call the local group structure on $U$ defined by
$$\{(A,B,P) \in U \times U \times U \mid AB=P\}
$$
They key fact is that for any neighborhood of the identity $U \subset G$, the Lie algebra of $G$ is completely determined by the local group structure on $U$: you can literally write down the definition of the elements of the Lie algebra (namely tangent vectors at the identity element) and of the Lie algebra operation itself, using only the elements of $U$ and the partial group operation on $U$. A proof of this fact should be an exercise in the definition of the Lie algebra.
To say that two Lie groups $G,G'$ have isomorphic local group structure means that there exist neighborhoods $U \subset G$ and $U' \subset G'$ of their respective identity elements, and there exists a diffeomorphism $f : U \to U'$, such that for any $(A,B,P) \in U$ we have $AB=P \iff f(A) f(B) = f(P)$. Combining this with the key fact described above, it follows that if two Lie groups have isomorphic local group structure then their Lie algebras are isomorphic.
Finally we simply need to prove that $O(n;\mathbb R)$ and $SO(n;\mathbb R)$ have isomorphic local group structure. To do that we use the fact that $SO(n;\mathbb R)$ is actually an open subroup of $O(n;\mathbb R)$, so we can simply take $U = SO(n;\mathbb R) \subset SO(n;\mathbb R)$ and $U' = SO(n;\mathbb R) \subset O(n;\mathbb R)$ as our two open subsets; the identity map from $U$ to $U'$ defines the isomorphism of local group structures.
