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*}
&amp;=\frac{n^2 ((-1)^n n^2 + 1 + \frac{1}{n^2})}{n^2(n^2+1)}\\
&amp;=\frac{(-1)^n n^2 + 1 + \frac{1}{n^2}}{(n^2+1)}\\
&amp;=\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})}\\
&amp;=\frac{(-1)^n + 0 +0}{1}\\
&amp;=\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$.
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.
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) \,.$$