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$.
 A: The problem here is that the sequence does not converge at all!
To prove this, consider the subsequence where $n$ is an even number, and show that the limit is $1$. Then take the subsequence where $n$ is an odd number, and show that the limit is $-1$. Now, if a sequence converges, so do all its subsequences, and the limit is the same! Therefore it can't converge.
A: 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).
A: Note that, for the limit of a sequence to exist, it has to be unique. That means the sequence has to converge to a single value. In your case the sequence has subsequences which converge to two different values, namely 
$ L = \left\{-1,1\right\}\,.$ So the limit does not exist. Here comes the notion of $\limsup$ and $\liminf$ which we use to define the existence of the limit. We say the sequence $a_{n}$ converges to $a$ $n\rightarrow \infty$, if 
$$ \liminf_{n\rightarrow \infty} a_n =\limsup_{n \rightarrow \infty} a_n = \lim_{n \rightarrow\infty} a_n \,.$$
In your case $\liminf_{n\rightarrow \infty} a_n =-1$ and $ \limsup_{n \rightarrow \infty} a_n = 1 $, so they are not equal and hence the limit of the sequence does not exist.
You can compare this to the case of taking limits of functions when we require for the limit to exist at a point $x_0$ that
$$ \lim_{x\rightarrow x_0^{-}} f(x) = \lim_{x\rightarrow x_0^{+}} f(x) = \lim_{x\rightarrow x_0} f(x) \,.$$     
