Prove that a specific integral of two $\mathcal{L}^2$ functions is in $\mathcal{L}^2$ 
Let $f \in \mathcal{L}^2(\mathbb{R})$ and $k \in \mathcal{L}^2(\mathbb{R \times\mathbb{R}})$. Consider the function
$$g(x)=\int_\mathbb{R}k(x,y)f(y)\,\text{d}\lambda(y)$$
Prove that $g \in \mathcal{L}^2(\mathbb{R})$.

Here's my incomplete attempt: For $g$ to be in $\mathcal{L}^2(\mathbb{R})$, it needs to be measurable and $\int_\mathbb{R} g\,\text{d}\lambda<\infty$.
$$\int_\mathbb{R}\left|\int_\mathbb{R}k(x,y)f(y)\,\text{d}\lambda(y)\right|^2\,\text{d}\lambda(x)\leq\int_\mathbb{R}\left(\int_\mathbb{R}\left|k(x,y)f(y)\right|\,\text{d}\lambda(y)\right)^2\,\text{d}\lambda(x)$$
by some elementary known inequality I can't remember the name of. Then we can apply Hölder's inequality to $p=q=2$ to find that the expression in the RHS is $\leq$ than
$$\int_\mathbb{R}\left(\int_\mathbb{R}\left|k(x,y)\right|^2\,\text{d}\lambda(y)\int_\mathbb{R}\left|f(y)\right|^2\,\text{d}\lambda(y)\right)^2\,\text{d}\lambda(x)$$
What can we do after this? I feel like using Hölder's inequality is the way to go, but I'm not sure what's the next step.
 A: To show that $g \in L^2(\mathbb R)$ you need to show to things:


*

*$g$ is measurable.

*$\Vert g \Vert_{\mathrm L^2(\mathbb R)} < \infty$.


The first assertion is clear from basic measure theory, since it follows from the hypothesis that $(x, y) \mapsto k(x,y) f(y)$ is measurable on the product space $\mathbb R \times \mathbb R$ and thus the function defined to be its integral in one variable is measurable.
The second assertion can be seen as follows: Since $k \in L^2(\mathbb R \times \mathbb R)$ you know that $k(x, \cdot) \in L^2(\mathbb R)$ for almosty every $x \in \mathbb R$. Thus, the Cauchy-Schwarz inequality tells you that
\begin{align*}
\left|\int_\mathbb{R}k(x,y)f(y)\,\text{d}\lambda(y)\right|^2 &= \left\vert \langle k(x, \cdot), f \rangle_{\mathrm L^2(\mathbb R)} \right\vert^2 \\
&\leq \Vert k(x, \cdot) \Vert_{\mathrm L^2(\mathbb R)}^2 \cdot \Vert f \Vert_{\mathrm L^2(\mathbb R)}^2 = \left(\int_\mathbb{R}\vert k(x,y) \vert ^2\,\text{d}\lambda(y) \right) \cdot \left(\int_\mathbb{R}\vert f(y) \vert ^2\,\text{d}\lambda(y) \right)
\end{align*}
for almost every $x \in \mathbb R$.
Thus, you obtain
\begin{align*}
\Vert g \Vert_{\mathrm L^2(\mathbb R)}^2 &= \int_\mathbb{R}\left|\int_\mathbb{R}k(x,y)f(y)\,\text{d}\lambda(y)\right|^2\,\mathrm d\lambda(x) \\
&\leq \int_\mathbb{R} \left(\int_\mathbb{R}\vert k(x,y) \vert ^2\,\text{d}\lambda(y) \right) \cdot \left(\int_\mathbb{R}\vert f(y) \vert ^2\,\text{d}\lambda(y) \right) \,\mathrm d\lambda(x) \\
&= \int_{\mathbb{R} \times \mathbb{R}}\vert k(x,y) \vert ^2\,\text{d}\lambda^2(x, y)  \, \cdot \, \int_\mathbb{R}\vert f(y) \vert ^2\,\text{d}\lambda(y) \\
&= \Vert k \Vert_{\mathrm L^2(\mathbb R \times \mathbb R )}^2 \cdot \Vert f \Vert_{\mathrm L^2(\mathbb R)}^2 < \infty.
\end{align*}
I hope the arguments got clear to you :)
