What is the number of subgroups of index $2$ in $(\mathbb{Z}/2\mathbb{Z})^3$? 
What is the number of subgroups of index $2$ in $(\mathbb{Z}/2\mathbb{Z})^3$?

I know that a subgroup of index $2$ in $(\mathbb{Z}/2\mathbb{Z})^3$ is isomorphic to $(\mathbb{Z}/2\mathbb{Z})^2$ because of the order of its elements, but I cannot say what is the number of this subgroups.
Also, is it possible to generalise this to the number of subgroups of index $2$ of $(\mathbb{Z}/2\mathbb{Z})^n$?

If you pick two distinct non-identity elements they are going to generate such a subgroup.
So the answer is $\binom{7}{2}$.
But wait ! Each subgroup can be generated in three ways like this.
Hence the answer is $\binom{7}{2}/3 = 7$
If you want to generalize it to $\mathbb Z_2^n$ you can use linear algebra. Notice that the map that sends each subspace of dimension $n-1$ to its orthogonal complement under the obvious inner product is a bijection between dimension $n-1$ subspaces and dimension $1$ subspaces (to prove bijectivity you can use the $e_i$ vectors, and see here)
Hence there are $2^n-1$ subgroups of index $2$.
