Prove the Pythagorean theorem and its converse in R : $f$ is orthogonal to $g$ if and only if
$$\|f-g\|^2=\|f\|^2+\|g\|^2$$
LHS -> RHS
\begin{align} & \|f-g\|^2 \\[10pt] = {} & (f,f)-2(f,g)+(g,g) \\[10pt] = {} & \|f\|^2-2(f,g)+\|g\|^2 \end{align}
In order for LHS=RHS $-2(f,g)$ has to be $0$ which means that $f$ and $g$ are othogonal. If $-2(f,g)=0$ Then
$$=\|f\|+\|g\|$$
RHS-> LHS
\begin{align} & \|f\|^2+\|g\|^2 \\[10pt] = {} & (f,f)+(g,g) \\[10pt] = {} & \|f-g\|^2 \text{ iff } -2(f,g)=0, \text{ iff } f \text{ and } g \text{ are orthogonal.} \end{align}
$||f-g||^2 = (f-g,f-g) = (f,f)-(f,g)-(g,f)+(g,g) = ||f||^2+||g||^2 - 2(f,g)$.
So $||f-g||^2 = ||f||^2+||g||^2$ iff $2(f,g) = 0$ iff f and g are orthogonal.