Also, how does the situation change when replacing $\mathbf{R}$ with $\mathbf{Q}$?
I have only very basic tools to approach this problem. My attempt at understanding it is that $PGL_n$ is the set of linear transformations which leave the norms of vectors the same, while $SL_n$ is the set of linear transformations which preserve volumes and their orientations. But I must have some misunderstanding because then one could consider in $PGL_4$ the matrix
$$\left(\begin{array}{cccc}-1 & 0 & 0 & 0 \\ 0 & 1 & 0 &0 \\ 0& 0&1&0\\0&0&0&1 \end{array}\right)$$
for which I do not think you can come up with a matrix in $SL_4$ to be its preimage. But I have high confidence that this approach is incorrect so I would like to be pointed in a better direction.
For odd $n$ the canonical homomorphism is such a surjection.
For even $n$, there is no continuous surjective homomorphism because the left-hand group is connected and the second is not.
Actually there is no surjective homomorphism at all, because the left-hand group is generated by 1-parameter subgroups, hence has no nontrivial homomorphism to a group of order 2 (or to any finite group).
For $\mathbf{Q}$, the latter argument adapts while the conclusion is different: there is no surjective homomorphism $\mathrm{SL}_n(\mathbf{Q})\to\mathrm{PGL}_n(\mathbf{Q})$ for any $n\ge 2$. Because the latter is generated by additive 1-parameter subgroups, it has no non-trivial homomorphism to any finite group. On the other hand the determinant map $\mathrm{GL}_n(\mathbf{Q}\to\mathbf{Q}^*$ induces a surjective homomorphism $\mathbf{PGL}_n(\mathbf{Q})\to\mathbf{Q}^*/(\mathbf{Q}^*)^n$, and the latter group surjects onto $\mathbf{Z}/n\mathbf{Z}$.