<s>[INST] limit of a sequence $(-1)^n$ instead $1$ I should calculate the limit of a sequence. A friend told me, that the solution is $1$. But I got $(-1)^n$.
The exercise is: $\lim\limits_{n \to \infty} \frac{1}{n^2} + (-1)^n \cdot \frac{n^2}{n^2+1}$
I did following:
$$\begin{align*}
&=\frac{n^2 ((-1)^n n^2 + 1 + \frac{1}{n^2})}{n^2(n^2+1)}\\
&=\frac{(-1)^n n^2 + 1 + \frac{1}{n^2}}{(n^2+1)}\\
&=\frac{n^2(\frac{(-1)^n n^2}{n^2} + \frac{1}{n^2} + \frac{1}{n^4})}{n^2(1 + \frac{1}{n^2})}\\
&=\frac{(-1)^n + 0 +0}{1}\\
&=\lim\limits_{n \to \infty} (-1)^n
\end{align*}$$
What did I wrong?
Edit
Well, some answers confused me. Here the complete exercise.
I should check if the sequence is convergent for ${n \to \infty}$ and determine the limit if it exist. Also for a sequence which is $\infty$ or $-\infty$.
My friend got $1$ as limit. I got $(-1)^n$. I would say, that this sequence has no limit, just  limit points $1$ and $-1$.
 [/INST] The limit of a sequence indexed by $n$ cannot contain $n$, as a limit is a number, not a sequence. So your answer $(-1)^n$ as outcome of the limit cannot be correct. However by writing
$$
  \frac1{n^2} + (-1)^n \frac{n^2}{n^2+1}=\frac1{n^2} + (-1)^n -(-1)^n\frac1{n^2+1}
$$
you can see that you sequence is the sum of three sequences $\frac1{n^2}$,  $(-1)^n$, and  $-(-1)^n\frac1{n^2+1}$, of which the first and the last are convergent (to $0$), and the middle one is divergent, which implies that the sequence diverges (it has no limit).
</s>