Expanded summary of comments:
- Yes, the first inner product is a special case of the second, with $w\equiv 1$
- There are multiple reasons to consider spaces with weighted inner product (called weighted $L^2$ spaces):
- Polynomials are not square integrable on unbounded intervals $I$ such as $\mathbb R$ or $[0,\infty)$. If one wishes to have an orthogonal basis of polynomials on $L^2(I)$, a weight must be used. Two popular weights are $\exp(-x^2)$ and $\exp(-x)$.
- Even on a bounded interval, polynomials with interesting properties (such as Chebyshev polynomials $T_n$ on $[-1,1]$) happen to be orthogonal with a weight different from $1$.
- Eigenfunctions of a differential equation with nonconstant coefficients tend to be orthogonal with respect to weights related to the coefficients.
Is there any meaning to the question: "Given 2 functions $f(x)$ and $g(x)$, determine whether they are orthogonal." (with no additional information)?
Without any context, this is an unacceptably vague question. If I had to guess, I'd say that the inner product $\int_D fg$ should be used, where $D$ is the intersection of domains of $f$ and $g$.