I saw this question that was asked a year ago: Centre of the special linear group $SL_2(\mathbb R)$ or $SL(2,\mathbb R)$
I will link the photo in question here:
Shouldn't the last line read, "$SL_n(\mathbb R)$ consists of $I, -I$ if n is even, and is trivial if n is odd"?
What is written is correct. The center of $SL_2(\mathbb{R})$ consists of $I,-I$. The author does not talk about $SL_n(\mathbb{R})$ for $n \geq 3$.
But you are right, for $n$ odd $-I$ has determinant $-1$ and thus does not live in $SL_n(\mathbb{R})$, thus definitely also not in its center.