Consider the linear programming Problem : Maximize $ z=5x +7y$ such that
$x-y \le 1$
$2x+y \ge 2$
$x+ 2y \le 4$
$x \ge 0,$$ y \ge 0$
what is the optimal value of $z$ ?
My attempt : From $x-y \le 1$ and $2x+y \ge 2$ we have $x=0,y=-1$
From $x-y \le 1$ and $x+ 2y \le 4$ we have $x=1, y=0$
From $2x+y \ge 2$ and $x+ 2y \le 4$, we have $x=0, y=2$
Now im confused that what i have to do and im not able to proceed further
You don't mention anything about $x$ and $y$ being integers, so you can't assume much about what their specific values are from inequalities. I assume they can be real numbers. If so, then your first line's attempt of
as well as the next $2$ lines, aren't necessarily true. Also, note having $y = -1$ doesn't satisfy that $y \ge 0$.
Instead, consider the $2$ conditions of
$$x-y \le 1 \tag{1}\label{eq1A}$$
$$x+ 2y \le 4 \tag{2}\label{eq2A}$$
Note \eqref{eq1A} plus $4$ times \eqref{eq2A} gives
$$z = 5x + 7y \le 17 \tag{3}\label{eq3A}$$
Thus, the largest potential maximum value is $17$. To confirm this is the actual maximum, you just need to find one set of values of $x$ and $y$ which satisfy \eqref{eq3A} and all of the other conditions. You can confirm that $x = 2$ and $y = 1$ work, so integral values do suffice in this case. Thus, the maximum value for $z = 5x + 7y$ is $17$.