I have read in few books (example Computational Number Theory, page 77) that any extension field $\mathbb{F}_{p^n}$ "contains" as a subfield the prime field $\mathbb{Z}_p$?
What exactly does "contains" mean? Since the representations of the two fields are not same (we have to use polynomials or some other structure to represent $\mathbb{F}_{p^n}$, while we use modular arithmetic to represent $\mathbb{Z}_p$), how can we say that one contains the other? Does it actually mean that it contains a subfield that is isomorphic to $\mathbb{Z}_p$?
For instance, we can represent $\mathbb{F}_{3^2}$ using arbitrary symbols $\{0, 1, a, b, c, d, e, f, g\}$ or by pairs $\{(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)\}$. How does this "contain" $\mathbb{Z}_3$?
This is more related to the computational perspective, so for example if I am working in $\mathbb{F}_{p^n}$, how do I represent the subfield and work directly on integers?
Additionally if the subfield is itself an extension field (i.e. $\mathbb{F}_{p^m}$ for some $m$ that divides $n$), how can I use a smaller data structure to represent it while at the same time keeping it also part of $\mathbb{F}_{p^n}$?
Technically it means that an isomorphic copy of $\Bbb{Z}_p$ is in $\Bbb{F}_{p^n}$. For example, in $\Bbb{F}_9$, the constant polynomials will be an isomorphic copy of $\Bbb{Z}_3$.
\begin{align*} \Bbb{F}_9 & =\Bbb{Z}_3[x]/\langle x^2+1\rangle\\ & =\{ax+b \, | \, a,b \in \Bbb{Z}_3, x^2+1 \equiv 0\}\\ &=\{0,1,2,x,x+1,x+2,2x,2x+1,2x+2\} \end{align*}
Then the set of constant polynomials $\{0,1,2\}$ is isomorphic to $\Bbb{Z}_3$.
With your edited version:
$\Bbb{F}_{p^n}$ can be thought of as a vector space over the field of scalars $\Bbb{Z}_p$. Thus each object in $\Bbb{F}_{p^n}$ is a $n-$tuple vector (this is very similar to the polynomial representation I have used above).
So consider the set of the vectors $$S=\{(0,0,\ldots ,c) \, | \, c \in \Bbb{Z}_p\}.$$ This set in $\Bbb{F}_{p^n}$ is isomorphic to $\Bbb{Z}_p$.