I have already proven following statement, but I am struggling to construct a counterexample, even with the hint. Every kind of help is appreciated:
Let $(X, A, \mu)$ be a measure space with $\mu(X) < \infty$. Show that for integrable functions $f_n: X \to \mathbb{R}$ converging uniformly to $f$, $f$ is also integrable. Construct a counterexample to demonstrate that this statement generally does not hold for $\sigma$-finite measures.
Hint: Construct a sequence $g_n$ of integrable functions with $0 \leq g_n \leq 1$ and $\int g_n \,d\mu \geq n^2$, and consider $f_n = \sum_{k=1}^{n} k^{-2}g_k$.
Presumably they want you to consider $\mathbb{R}$ with the Lebesgue measure.
Before even constructing a specific example of $g_n$, you can show that if there exists some $g_n$ that satisfies the properties given in the hint, then it is a valid counterexample. [Then, all you need to do is produce one example of a $g_n$ satisfying the properties. As Mark said, pick the easiest example you can think of.]
Let $f = \sum_{k=1}^\infty k^{-2} g_k$. Use the fact that $g_k \le 1$ to show that $|f-f_n|$ is small uniformly over $\mathbb{R}$.
Then, use the fact that $\int g_n \, d\mu \ge n^2$ to obtain a lower bound for $\int f_n \, d\mu$. What does this say about integrability of $f$?