Find a continuous function $f:[1,\infty)\to\Bbb R $ such that $f(x) >0 $, $\int_1^\infty f(x)\,dx $ converges and $\int_1^\infty f(x)^2\,dx$ diverges I'm trying to find an example of a continuous function $f:[1,\infty) \to \Bbb R $ such that 
$$f(x) &gt;0 $$

$$\int_{1}^{\infty} f(x) \ dx \ \text{converges and } \int_{1} ^{\infty} f(x)^2 dx \ \text{diverges}.$$
Consider at $x=k\in{\mathbb N}_{\geq2}$ a trapezoidal spike of height $k$ with base $\left[k-{2\over k^3},\  k+{2\over k^3}\right]$ and top $\left[k-{1\over k^3},\  k+{1\over k^3}\right]$. Let $f: \&gt;[1,\infty)\to{\mathbb R}$  be the function obtained by "concatenation" of these spikes. The area of the spike at $k$  is ${3\over k^2}$, so that 
$$\int_1^\infty f(x)\&gt;dx=3 \sum_{k=2}^\infty {1\over k^2}={\pi^2\over2}-3&lt;\infty\ .$$
On the other hand each spike of $f^2$ contains a rectangle of width ${2\over k^3}$ and height $k^2$. It follows that
$$\int_1^\infty f^2(x)\&gt;dx\geq\sum_{k=2}^\infty{2\over k}=\infty\ .$$
Add $e^{-x}$ to $f(x)$, as in Sangchul Lee's answer, to make $f$ positive everywhere.
A simpler example might be $f(x) = \frac{\sin{x}}{\sqrt{x}}$. Since $\frac{1}{\sqrt{x}}$ is continuously differentiable and monotonically decreasing to 0, and since $\sin{x}$ has a bounded and integrable anti-derivative, from Dirichlet's test $\int\limits_1^{\infty}\frac{\sin{x}}{\sqrt{x}}dx$ converges. Integration by parts shows that $\int\limits_1^{\infty}\frac{\sin^2{x}}{x}dx$ diverges.