Let $G$ be a group. Consider now the set of all (left for instance) cosets in $G$ of subgroups of finite index. This set is a base for a topology in $G$.
I found somewhere that if $G$ is residually finite then $G$ is a compact space in this topology but I cannot see why. First of all, is it true? Second, any (maybe more group theoretical) hints?
The statement is not true. The group of integers $\mathbf Z$ is residually finite. On the other hand, consider the open sets $U_p\subseteq \mathbf Z$ defined by $U_p = p\mathbf Z$, where $p$ runs over the primes. Clearly $\{U_p\} \cup \{5 \mathbf{Z} +1\} \cup \{5 \mathbf{Z} -1\}$ is an open covering of $\mathbf Z$ (as any integer is either $\pm 1$ or divisible by some prime). But this covering has no finite sub-covering: by the Chinese Remainder Theorem, there is no finite set of primes such that each integer which is $\pm 2$ mod $5$ is divisible by one of those primes.
We can give a criterion. To say that $G$ is residually finite is to say that the canonical morphism $G \to \widehat{G}$ from $G$ to its profinite competion is injective. Thus, if $G$ is residually finite, $G$ embeds as a dense subgroup of the compact group $\widehat{G}$. Since $\widehat{G}$ is Hausdorff and compact, $G$ will be compact precisely when it is closed in $\widehat{G}$ - which is to say, precisely when $G=\widehat{G}$.
(Thanks to studiosus for pointing out my earlier mistake. My mistake lied in the silly statement that open subsets of profinite groups are closed - which is false. Open subgroups are closed, but open subsets need not be closed! For instance, the complement of a point in an infinite profinite group is obviously not closed.)