In this case, since $a$ and $b$ are independent, and they don't interact in the value of the function, all you need to do is find the value of $a$ that maximizes $\frac{a-1}{4}$ and find the value of $b$ that maximizes $\frac{b}{2}$. They are both rather trivial to do. If it helps, the maximum value of $x$ is $\frac{1}{2}$.
In view of the edit, the actual problem is to maximize $\frac{a-1}{4} + \frac{b}{2}$ subject to the constraints $0\leq a\leq 1,\qquad 0\leq b\leq 1,\qquad 0\leq a+b\leq 1.$
That means that you are trying to maximize this function on on right triangle with vertices on $(0,0)$, $(1,0)$, and $(0,1)$, instead of on the unit square.
It is plain that the maximum will occur on the boundary, because moving further away from $(0,0)$ will never decrease the summands.
So it either occurs on the line $a=0$, $0\leq b\leq 1$ (the maximum along this line is $\frac{1}{4}$, obtained at $(0,1)$); or on the line $b=0$, $0\leq a\leq 1$ (the maximum along this line is $0$, obtained at $(1,0)$); or along the line $a+b = 1$. On this line, the function equals $\frac{b}{4}$, so the maximum occurs when $b=1$, $a=0$, same as before.
So the maximum value for $x$ is $\frac{1}{4}$, when $a=0$ and $b=1$.