Let $G$ be a group with $n$ elements and $k\in \mathbb{N}$. I am given that for any subgroup $H$ of $G$ we have that $H=\{a^k \mid a\in H\}$. What does this mean?
I believe it means that any element $x$ of $H$ can be written as $y^k$ for some $y\in H$ (i.e. $x=y^k$). Am I right?
Yes you are right.
$\{a^k|a \in H\}$ is a set. It is the set you get if you take every element and raise it to the $k$ power. If $k = 7$ say and the elements of $H$ are $\{a_1, a_2, a_3,....., a_n\}$ the $\{a^k|a\in H\}$ would be the set $\{a_1^7, a_2^7, a_3^7,...., a^n\}$
(I suppose I should point out that I am implying $H$ is countable. There is no need to assume that. Even if $H$ is uncountable, if $x \in H$ then $x^7 \in \{a^k|a \in H\}$ and if $y \in \{a^k|a \in H\}$ then there is an $a\in H$ so that $y=a^7$.)
So this statement is a theorem with the (unexpected) result that the set of all elements of $H$ each raised to the $k$ power (that is the set $\{a^k|a\in H\}$, results in the same set as the elements of $H$ (that is the set $H$ itself). Hence for any $x \in H$ there is a $y\in H$ so that $x = y^k$ (and obviously for every $y\in H$ then $y^k$ is also in $H$).
The is not an expected result.
It's obvious as the binary operation of $H$ is closed that $\{a^k|a\in H\}\subset H$, but it is not expected that $H \subset \{a^k|a\in H\}$.
=====
Here's an example where it is not true.
Let $G= Z_{56}$ with modular addition. Let $H = \{0,4,8,......., 48,52\}$ be a subgroup. Let $k = 7$.
The $\{a\times 7|a\in H\}$[1]$ = \{0\times 7, 4\times, 7, 8\times 7,.... ,48\times 7, 52\times 7\} = \{0,28,0,...0,28\} = \{0,28\} \ne H$.
Her's an example where it is true.
Let $G = Z_{56}$ again and $H=\{0,4,8,....,48,52\}$ again, but $k = 5$. Then $\{a\times 5|a\in H\} = \{0\times 5, 4\times 5, 8\times 5 , ....., 48\times 5, 52\times 5\} = \{0,20, 40, 4, 24,44,8,28, 48, 12,32,52,16,36\} = H$.
...
I assume the theorem is something about how $k$ relates to $n$. I'd even bet that maybe the theorem is that $\gcd(k,n)=1$. (or maybe that $\gcd(k, |H|) = 1$.)
======
[1] $a^k$ means perform the binary operation $k$ times. If the binary operation is addition the $a^7$ means $a + a+ a+a+a+a+a = a\times 7$.