Extrema of two variable function 
Find extrema of $f(x,y)=x^2-xy+y^2$ from set $M=\{ [x,y] \in \mathbb{R}^2;|x|+|y|\le1\}$

I am solving this kind of problems for the first time and I am not sure what I am doing, what I have got is:

M is compact set(it is bounded and it is closed) and $f$ is continuous, therefore $f$ has maximum and minimum in set M

Firstly I tried to solve it for $Int(M)=\{[x,y] \in \mathbb{R}^2;|x|+|y|<1\}$
$$\nabla f(x,y)=(2x-y,2y-x)=0 \Leftrightarrow (x,y)=(0,0)$$
Which is first "suspicious" point for extreme, but then I got stuck with the the border of my set $B(M)=\{ [x,y] \in \mathbb{R}^2;|x|+|y|=1\}$. I suppose it is possible either without Lagrange multiplier( in somewhat elementary way) or with it, which we just learnt in class recently, and I don't know how to apply it here. 
 A: The region $ \ |x| + | y | ≤ 1 \ $ is a square with its interior bounded by the four lines $ \ (\pm x) + (\pm y) \ = \  1 \ \ .  $  The function $ \ f(x,y) = x^2 - xy + y^2 \ $ likewise has symmetry about the origin.  We may then expect that two extremal values for the function would occur, one for the points $ \ (\pm x , \pm x) \ $ at which the value of the function is $ \ x^2 - x·x + x^2 \ = \ x^2 \ $ , the other at the points   $ \ (\pm x , \mp x) \ $ with the associated value   $ \ x^2 - x·(-x) + x^2 \ = \ 3x^2 \ \ . $
There are two sets of Lagrange equations here, since there are two pairs of constraint lines:
$ \ \mathbf{x + y = \pm 1  :} \quad 2x - y \ = \ \lambda·1 \ \ , \ \ -x + 2y \ = \ \lambda · 1 \ \ \Rightarrow \ \ \lambda \ = \ 2x - y \ = \ -x + 2y $
$$ \Rightarrow \ \ 3x \ = \ 3y \ \ \Rightarrow \ \ x = y = \pm \ \frac12 $$ $$\Rightarrow \ \ f \left( \pm \ \frac12 \ , \ \pm \ \frac12 \right) \ = \ \left( \pm \ \frac12  \right)^2 - \ \left( \pm \ \frac12  \right)\left( \pm \ \frac12  \right) + \left( \pm \ \frac12  \right)^2 \ = \ \frac14 \ \ ; $$
$ \ \mathbf{x - y = \pm 1  :} \quad 2x - y \ = \ \lambda·1 \ \ , \ \ -x + 2y \ = \ \lambda · -1 \ \ \Rightarrow \ \ \lambda \ = \ 2x - y \ = \ x - 2y $
$$ \Rightarrow \ \ x \ = \ -y \  = \ \pm \ \frac12 $$ $$\Rightarrow \ \ f \left( \pm \ \frac12 \ , \ \mp \ \frac12 \right) \ = \ \left( \pm \ \frac12  \right)^2 - \ \left( \pm \ \frac12  \right)\left( \mp \ \frac12  \right) + \left( \mp \ \frac12  \right)^2 \ = \ \frac34 \ \ . $$
These are two of the values found also by Jason Zimba , which the function attains at the midpoints of the edges of the square.
However, this is a situation that points up the limitations of the Lagrange-multiplier method.  The level curves for the function are rotated ellipses; while the curves $ \ x^2 - xy + y^2 \ = \ \frac14 \ $ and $ \ x^2 - xy + y^2 \ = \ \frac34 \ $ are indeed tangent to opposite sides of the square, the vertices are not covered at all by this approach.  The level curve $ \ x^2 - xy + y^2 \ = \ \mathbf{1} \ $ passes through all four vertices of the square, but cannot be tangent at any of them since the slopes of the sides change discontinuously at the vertices.  The value of the function there needs to be determined in a separate calculation.
Likewise, the "level curve" $ \ x^2 - xy + y^2 \ = \ 0 \ $ is simply the point at the origin, where the value of the function is zero.  So again, the Lagrange method cannot locate this.  We instead find this "critical point" of the function by setting the first partial derivatives $ \ 2x - y \ $ and $ \ -x + 2y \ $ equal to zero; the origin is the intersection of the lines $ \ y = 2x \ $ and  $ \ y = \frac12 x \ $  (as you have shown).  The geometrical situation is represented in the graph below, which may make it clearer why the Lagrange method "misses" the absolute extremal values for this region.

A: *

*You can first see that 
$$
x^2 - xy + y^2 = (x-y/2)^2 + 3/4 y^2
$$
here it is obvious to see that the minimum is in $(0,0)$.

*In general, it is convex function, so the global minimum is unique, and if a minimum is local then it is global. As you found a local minimum inside the domain, there is no need to look at the border.

*Now if you did not see any of this, you have to define a path of the border, so for example:
$$
x = t, y = 1-t, 0< t< 1
$$for the first border, and look for the minimum of the new 1 variable function (4 times, if you cut your border in 4 pieces).
A: Here is a straight-ahead, no-clever way. 
First compute $f$ at the corners; you get $f = 1$ in every case.
Next compute $f$ on the open edges like $y = 1 - x$ for $0 < x < 1$. On this edge, $f(x,y) = x^2 - x(1-x)+(1-x)^2 = 3x^2 - 3x + 1$. Using first-semester calculus, this has a local minimum of $1/4$. Do the other edges the same way.
The local minima of $f$ on the edges come to be $3/4$ and $1/4$. 
Now for the interior. You found a local minimum of $0$. 
Now put it all together. The smallest value we saw was $0$, and the largest value was $1$. Those are the global maxima and minima of $f$ on $M$.
