Find minimum value of the function If $g(x) = \max|y^2 - xy|$ for $0\leq y\leq 1$. Then the minimum value of $g(x)$ is?
I am not being able to proceed. Tried drawing the graph.

\begin{align*}
&\text{First suppose $x < 0$.}\\[6pt]
&\text{Then}\;\;x < 0\\[4pt]
&\implies\, y > x&&\text{[since $0 \le y \le 1$]}\\[4pt]
&\implies\, y(y-x) \ge 0\\[4pt]
&\implies\, y^2-xy \ge 0\\[4pt]
&\implies\, g(x) = \max(y^2-xy)\\[4pt]
&\qquad\qquad\qquad\;\;\text{(for $0 \le y \le 1$)}\\[4pt]
&\implies\, g(x) = \max(0,1-x)&&\text{[no local max, so}\\[2pt]
&&&\,\text{max must occur at $y=0$ or $y=1$]}\\[4pt]
&\implies\, g(x) = 1-x\\[12pt]
&\text{Next suppose $1 < x \le 2$.}\\[6pt]
&\text{Then}\;\;1 < x \le 2\\[4pt]
&\implies\, y < x&&\text{[since $0 \le y \le 1$]}\\[4pt]
&\implies\, y(x-y) \ge 0\\[4pt]
&\implies\, xy-y^2\ge 0\\[4pt]
&\implies\, g(x) = \max(xy-y^2)\\[2pt]
&\qquad\qquad\qquad\;\;\text{(for $0 \le y \le 1$)}\\[4pt]
&\implies\, g(x) = \max(0,x-1,x^2/4)&&\text{[max occurs at}\\[2pt]
&&&\,\text{$y=0,\;y=1$}\\[2pt]
&&&\,\text{or$\;y=x/2$ (critical point)]}\\[6pt]
&\implies\, g(x) = x^2/4&&\text{[since $x^2/4 \ge x-1$]}\\[12pt]
&\text{Next suppose $x > 2$.}\\[6pt]
&\text{Then}\;\;x>2\\[4pt]
&\implies\, y < x&&\text{[since $0 \le y \le 1$]}\\[4pt]
&\implies\, y(x-y) \ge 0\\[4pt]
&\implies\, xy-y^2\ge 0\\[4pt]
&\implies\, g(x) = \max(xy-y^2)\\[4pt]
&\implies\, g(x) = \max(0,x-1)&&\text{[max occurs at}\\[4pt]
&&&\,\text{$y=0,\;y=1$}\\[4pt]
&&&\,\text{($y = x/2 \notin [0,1]$)]}\\[4pt]
&\implies\, g(x) = x-1\\[12pt]
&\text{Next suppose $0 \le x \le 1$.}\\[6pt]
&\text{Then by previous logic}\\[4pt]
&\phantom{\implies\,}
g(x)
=
\begin{cases}
1-x &\text{if}\;\;1-x \ge x^2/4\\[3pt]
x^2/4 &\text{if}\;\;x^2/4 > 1-x
\end{cases}
\\[6pt]
&\text{Equivalently, for $0 \le x \le 1$}\\[4pt]
&\phantom{\implies\,}
g(x)
=
\begin{cases}
1-x &\text{if}\;\;0 \le x \le 2\sqrt{2}-2\\[3pt]
x^2/4 &\text{if}\;\;2\sqrt{2}-2 < x \le 1
\end{cases}
\\[12pt]
&\text{Collecting the results obtained so far}\\[6pt]
&\phantom{\implies\,}
g(x)
=
\begin{cases}
1-x &\text{if}\;\;x \le 2\sqrt{2}-2\\[3pt]
x^2/4 &\text{if}\;\;2\sqrt{2}-2 < x \le 2\\[3pt]
x-1 &\text{if}\;\;x >2
\end{cases}
\\[12pt]
&\text{Looking at each of the $3$ pieces in turn},\\[2pt]
&\text{it follows that $g$ is}\\[2pt]
&\phantom{\implies\,}{\small{\bullet}}\;\;\text{decreasing on the interval $(-\infty,2\sqrt{2}-2]$},\\[2pt]
&\phantom{\implies\,}{\small{\bullet}}\;\;\text{increasing on the interval $(2\sqrt{2}-2,\infty)$}\\[4pt]
&\text{hence the minimum value of $g$ is}\\[4pt] 
&\phantom{\implies\,}\;\,g(2\sqrt{2}-2)\\[4pt]
&\phantom{\implies\,}=1 - \left(2\sqrt{2}-2\right)\\[4pt]
&\phantom{\implies\,}=3 - 2\sqrt{2}
\end{align*}
