$n$ is a square and a cube $a^2 = n = b^3\Rightarrow n\equiv 0,1\pmod{7}$ 
Verify that if an integer is simultaneously a square and a cube, then it must be either of the form ${7k}$ or ${7k +1}$.

I have no idea on how to proceed.
 A: If an integer $a$ is simultaneously a square and a cube, it must be the sixth power of an integer $b$
Now as $7$ is prime either $7|b$ or $(7,b)=1$
If $7|b, 7|b^n$ for integer $n\ge1$
Else by Fermat's Little Theorem , $7|(b^{7-1}-1)$
A: Check the integers mod $7$. Which are squares and which are cubes:
$$0^2=0^3=0$$
$$1^2=1^3=1$$
$$2^2 = 4,\qquad 2^3=8\equiv 1$$
$$3^2 = 9 \equiv 2,\quad3^3=27\equiv 6$$
$$4^2 = 16 \equiv 2,\quad 4^3= 64 \equiv 1$$
$$5^2 = 25 \equiv 4,\quad 5^3= 125 \equiv 6$$
$$6^2 = 36 \equiv 1,\quad 6^3=216\equiv 6.$$
So only $0, 1, 2$ and $4$ are squares, only $0, 1$ and $6$ are cubes (mod $7$). The ones that are both give the wanted answer.
A: If $n$ is simultaneously a cube, 
$$n\equiv a^3\equiv -1,0,1\pmod{7}$$
and a square 
$$n\equiv t^2\equiv 0,1,4,2\pmod{7}$$
Therefore $n$ is either $7k$ or $7k+1$
A: Specialize $\, i = 2,\,j=3,\, p = 7\,$ below, $ $  using little Fermat  $ = \color{#c0d}{\mu F}$.
Theorem $\bmod p\!:\ \color{#c00}{a^{\large i}} \equiv \color{#0a0}{b^{\large j}}\equiv n\not\equiv 0\Rightarrow n^{j-i}\equiv 1\ $ if $\ p = ij+1\,$ is prime.
Proof $\ \ n\not\equiv 0\Rightarrow a,b\not\equiv 0\,$ so $\,n^{j-i}\equiv\dfrac{n^{\large j}}{n^{\large i}}\equiv \dfrac{(\color{#c00}{a^{\large i}})^{\large j}}{(\color{#0a0}{b^{\large j}})^{\large i}}\equiv\dfrac{a^{\large p-1}}{b^{\large p-1}}\,\overset{\color{#c0f}{\mu F}}\equiv\, \dfrac{1}{1}.\ $ $\bf\small QED$
Remark $ $ We can generalize the Theorem by replacing "$p = ij\!+\!1$ is prime" $ $ by $ $ "$\phi(p)\mid ij$"
Generally $\,n^i\equiv 1\equiv n^j\Rightarrow n\equiv 1 $ when $\,(i,j)\!=\!1\,$ since then by Bezout $\,ii'\!+\!jj'\!=\!1\,$ so $\, 1 \equiv (n^i)^{i'}(n^j)^{j'}\! \equiv n^{ii'+jj'}\! \equiv n\,$ (or use $\,{\rm ord}(n)$  divides coprimes $\,i,j\,$ so must be $1,\,$ as here).
