The question as well as the answer by Calum Gilhooley address the case over a real vector space. Here I briefly mention that the result carries over to the complex case and mention some proofs that carry over to this setting.
Let $X$ be a vector space over $\mathbb{K}$, where $\mathbb{K}$ is fixed as one of $\mathbb{R}$ or $\mathbb{C}$. We say a map $u\colon X\times X \to \mathbb{K}$ is a semi-inner product on $X$ if it satisfies the following three conditions.
For all $x, y, z\in X$ and $\lambda \in \mathbb{K}$ we have
\begin{align*}
u(x + y, z) &= u(x, z) + u(y, z) , \\
u(x, y + z) &= u(x, y) + u(x, z) , \\
u(\lambda x, y) &= \alpha u(x, y) \text{ and } \\
u(x, \alpha y) &= \overline{\lambda} u(x, y) .
\end{align*}
We have $u(y, x) = \overline{u(x, y)}$ for all $x, y\in X$.
We have $u(x, x) \geq 0$ for all $x\in X$.
Observe that a semi-inner product $u$ on a vector space $X$ (over $\mathbb{K}$) is an inner product if and only if for each $x\in X$ the condition $u(x, x) = 0$ implies $x = 0$. We now show the following.
Proposition 1. Let $X$ be a vector space over $\mathbb{K}$ and $u$ a semi-inner product on $X$. Then for every $x, y\in X$ we have
\begin{equation}
|u(x, y)|^{2} \leq u(x, x) u(y, y) . \tag{1}
\end{equation}
Proof 1. Let $x, y\in X$. If $u(y, y) = 0$ the result is clear. So we assume $u(y, y) \neq 0$. Let $\lambda \in \mathbb{K}$. We have
\begin{equation}
\begin{aligned}
0 \leq u(x - \lambda y, x - \lambda y) &= u(x, x) - \lambda u(y, x) - \overline{\lambda} u(x, y) + |\lambda |^{2} u(y, y) \\
&= u(x, x) - 2 \, {\rm Re}(\overline{\lambda} u(x, y) ) + |\lambda |^{2} u(y, y) .
\end{aligned} \tag{2}
\end{equation}
By taking $\lambda = \frac{u(x, y) }{u(y, y) }$ in $(2)$ we get
\begin{equation}
0 \leq u(x, x) - 2\frac{|u(x, y)|^{2} }{u(y, y) } + \frac{|u(x, y)|^{2} }{u(y, y) } = \frac{u(x, x) u(y, y) - |u(x, y)|^{2} }{u(y, y) } . \tag{3}
\end{equation}
From $(3)$ we deduce $0 \leq u(x, x) u(y, y) - |u(x, y)|^{2}$ and the result follows.
Proof 2. Let $x, y\in X$. If $u(y, y) = 0$ the result is clear. So we assume $u(y, y) \neq 0$. Choose $\alpha \in \mathbb{K}$ such that $u(x, y) = \alpha |u(x, y)|$. Define $z = \alpha y$. For each $t\in\mathbb{R}$ we have
\begin{equation}
\begin{aligned}
0 \leq u(x - tz, x - tz) &= u(x, x) - tu(z, x) - tu(x, z) + t^{2} u(z, z) \\
&= u(x, x) - 2t |u(x, y)| + t^{2} u(y, y) .
\end{aligned} \tag{4}
\end{equation}
Define $p\colon \mathbb{R}\to\mathbb{R}$ by $p(t) := u(y, y) t^{2} - 2|u(x, y)| t + u(x, x)$. Then $p$ is a quadratic polynomial satisfying $p(t) \geq 0$ for all $t\in\mathbb{R}$. We readily see that the polynomial $p$ attains its minimum at the value $t_{0} = \frac{|u(x, y)| }{u(y, y) }$. Then by evaluating $(4)$ at this value, we get
\begin{equation}
\begin{aligned}
0 \leq u(x - t_{0}z, x - t_{0}z) &= u(x, x) - 2\frac{|u(x, y)|^{2} }{u(y, y) } + \frac{|u(x, y)|^{2} }{u(y, y) } \\
&= \frac{u(x, x) u(y, y) - |u(x, y)|^{2} }{u(y, y) } .
\end{aligned} \tag{5}
\end{equation}
Hence we deduce from $(5)$ that $0 \leq u(x, x) u(y, y) - |u(x, y)|^{2}$ and the result follows.
Note that we can also characterise when equality in $(1)$ occurs.
Proposition 2. Let $X$ be a vector space over $\mathbb{K}$ and $u$ a semi-inner product on $X$. Then for every $x, y\in X$ we have
\begin{equation}
|u(x, y)|^{2} = u(x, x) u(y, y)
\end{equation}
if and only if we have one of $u(y, y) = 0$ or otherwise $u(x - \lambda y, x - \lambda y) = 0$ for some $\lambda\in\mathbb{K}$.
Proof. See here.
A reference for the result from Proposition 1 is Proposition 3.3 in Functional Analysis by van Neerven (see here).