Let $f\colon \mathbb R ^2 \rightarrow \mathbb R$ be given by $f(x,y)=(x^2-y^2)e^{-x^2-y^2}$.

a) Prove that $f$ attains its minimum and its maximum.

b) Determine all points $(x,y)$ such that $\frac{\partial f}{\partial x}(x,y)=\frac{\partial f}{\partial y}(x,y)=0$ and determine for which of them $f$ has global or local minimum or maximum.
### Part (a)

1. **Show that \( \lim_{(x,y) \to \infty} f(x,y) = 0 \):**

   We start by expressing \( f(x,y) \) in polar coordinates. Let \( x = r \cos \theta \) and \( y = r \sin \theta \). Then,
   \[
   f(x,y) = (x^2 - y^2) e^{-x^2 - y^2} = (r^2 \cos^2 \theta - r^2 \sin^2 \theta) e^{-r^2} = r^2 (\cos^2 \theta - \sin^2 \theta) e^{-r^2} = r^2 \cos 2\theta e^{-r^2}.
   \]
   Taking the absolute value, we get:
   \[
   |f(r, \theta)| = |r^2 \cos 2\theta e^{-r^2}| \leq r^2 e^{-r^2}.
   \]
   Now, consider the limit:
   \[
   \lim_{r \to \infty} r^2 e^{-r^2}.
   \]
   Using L'Hôpital's rule, we have:
   \[
   \lim_{r \to \infty} \frac{r^2}{e^{r^2}} = \lim_{r \to \infty} \frac{2r}{2r e^{r^2}} = \lim_{r \to \infty} \frac{1}{e^{r^2}} = 0.
   \]
   Therefore,
   \[
   \lim_{(x,y) \to \infty} f(x,y) = 0.
   \]

2. **Show that \( f \) is differentiable and thus continuous:**

   Since \( f(x,y) = (x^2 - y^2) e^{-x^2 - y^2} \) is composed of polynomials and the exponential function, which are both differentiable, \( f \) is differentiable everywhere in \( \mathbb{R}^2 \).

3. **Apply the Extreme Value Theorem:**

   The Extreme Value Theorem states that a continuous function on a closed and bounded set attains its maximum and minimum values. Although \( \mathbb{R}^2 \) is not bounded, the behavior at infinity (where \( f \) approaches 0) and the differentiability of \( f \) imply that \( f \) must attain its global maximum and minimum at some points in \( \mathbb{R}^2 \).

Thus, \( f \) attains its minimum and maximum.

### Part (b)

1. **Find the critical points by solving \( \frac{\partial f}{\partial x} = 0 \) and \( \frac{\partial f}{\partial y} = 0 \):**

   Compute the partial derivatives:
   \[
   f_x(x,y) = \frac{\partial}{\partial x} \left( (x^2 - y^2) e^{-x^2 - y^2} \right) = 2x e^{-x^2 - y^2} - 2x (x^2 - y^2) e^{-x^2 - y^2} = 2x (1 - x^2 + y^2) e^{-x^2 - y^2},
   \]
   \[
   f_y(x,y) = \frac{\partial}{\partial y} \left( (x^2 - y^2) e^{-x^2 - y^2} \right) = -2y e^{-x^2 - y^2} - 2y (x^2 - y^2) e^{-x^2 - y^2} = -2y (1 + x^2 - y^2) e^{-x^2 - y^2}.
   \]

2. **Set the partial derivatives to zero:**

   \[
   f_x(x,y) = 2x (1 - x^2 + y^2) e^{-x^2 - y^2} = 0,
   \]
   \[
   f_y(x,y) = -2y (1 + x^2 - y^2) e^{-x^2 - y^2} = 0.
   \]

   This gives us the system:
   \[
   2x (1 - x^2 + y^2) = 0,
   \]
   \[
   -2y (1 + x^2 - y^2) = 0.
   \]

3. **Solve the system:**

   For \( f_x(x,y) = 0 \):
   \[
   x = 0 \quad \text{or} \quad 1 - x^2 + y^2 = 0.
   \]

   For \( f_y(x,y) = 0 \):
   \[
   y = 0 \quad \text{or} \quad 1 + x^2 - y^2 = 0.
   \]

   Combining these, we get the following cases:
   - \( x = 0 \) and \( y = 0 \) gives the point \( (0,0) \).
   - \( x = 0 \) and \( 1 + y^2 = 0 \) is not possible since \( y^2 \geq 0 \).
   - \( y = 0 \) and \( 1 - x^2 = 0 \) gives the points \( (1,0) \) and \( (-1,0) \).
   - \( 1 - x^2 + y^2 = 0 \) and \( 1 + x^2 - y^2 = 0 \) gives the points \( (0,1) \) and \( (0,-1) \).

4. **Evaluate \( f \) at the critical points:**

   \[
   f(0,0) = (0^2 - 0^2) e^{-0^2 - 0^2} = 0,
   \]
   \[
   f(1,0) = (1^2 - 0^2) e^{-1^2 - 0^2} = e^{-1},
   \]
   \[
   f(-1,0) = ((-1)^2 - 0^2) e^{-(-1)^2 - 0^2} = e^{-1},
   \]
   \[
   f(0,1) = (0^2 - 1^2) e^{-0^2 - 1^2} = -e^{-1},
   \]
   \[
   f(0,-1) = (0^2 - (-1)^2) e^{-0^2 - (-1)^2} = -e^{-1}.
   \]

5. **Determine the nature of the critical points:**

   - \( f(0,0) = 0 \) is neither a maximum nor a minimum.
   - \( f(1,0) = e^{-1} \) and \( f(-1,0) = e^{-1} \) are global maxima.
   - \( f(0,1) = -e^{-1} \) and \( f(0,-1) = -e^{-1} \) are global minima.

The final answer is \( \boxed{ (1,0) } \) and \((-1,0)\) are global maxima, \((0,1)\) and \((0,-1)\) are global minima, and \((0,0)\) is neither a maximum nor a minimum.