Using pumping lemma show that language $L = \{a^{n^2} | n≥ 0\}$ is not regular.
Is this approach correct?
Let's assume that $L$ is regular so then the pumping lemma applies.
Let $w = a^{n^2} ∈ L$.
We can split $w$ into $w = xyz$ such that $|y| > 0 ,\ |xy| ≤ z$,$\ \forall i ≥ 0: xy^iz ∈ L$
$$|w|=n^2 ≥ n$$
Let $x,y,z$ be:
$$\begin{split} x& = λ\\ y &= a^k, k > 0, k ≤ n\\ z &= a^{n^2-k}\\ \end{split}$$
If $i = 2$,$\ w^* = xyyz ∈ L$, $\ w^*=a^{n^2+k}$, because $1≤k≤n$ then:
$$n^2<n^2+k<(n+1)^2 \implies n^2<|xy^2z|<(n+1)^2 \implies xy^2z ∉ L$$
That is a contradiction with the pumping lemma so $L$ is not a regular language.
You need to be more careful with the logic. The Pumping Lemma says that if $L$ is regular then
(six quantifiers!!!). So, supposing that $L$ is regular, you need do something like this.
This is a little tricky. One way is to observe that the gaps between squares increase, so soon or later, the value of $n^2+(i-1)k$ must "fall into a gap" and not be a square.
Another way is to play around a little bit and find that if $i=n^4k+1$ then $$(n^2k)^2<|xy^iz|<(n^2k+1)^2\ .$$
The best way of all is to use the more advanced version of the Pumping Lemma, see here for example.