Piecewise Function and Convergence I am working on a question involving the piecewise function given below. I am looking for a check on my work and clarification on the bounds of the function as $n \to \infty$.
For $n \geq 1$, define functions $f_n$ on $[0, \infty)$ by
$$f_n(x) = \left\{
        \begin{array}{lll}
            e^{-x} & \mathrm{for} \; 0 \leq x \leq n \\
            e^{-2n}(e^n+n-x) & \mathrm{for} \; n \leq x \leq n +e^n  \\
            0 & \mathrm{for} \;  x \geq n + e^n
        \end{array}
    \right.
$$

(a) Find the pointwise limit $f$ of $f_n$. 

So, I am interested in $\lim_{n \to \infty} f_n(x)$. It seems that
$$\lim_{n \to \infty} f_n(x)=e^{-x}$$
but I am unclear due to the behavior of the bounds as $n \to \infty$. As $n \to \infty$ we have
$$f_n(x) = \left\{
        \begin{array}{lll}
            e^{-x} & \mathrm{for} \; 0 \leq x \leq \infty \\
            0 & \mathrm{for} \; \infty \leq x \leq \infty + \infty  \\
            0 & \mathrm{for} \;  x \geq \infty + \infty
        \end{array}
    \right.
$$
where I have written $\infty + \infty$ etc. just to show my understanding of what is happening. The function is defined over $[0, \infty )$ and as such $f_n(x) = e^{-x}$ as $n \to \infty$. Further, we cannot have $x \geq \infty$...

Show that the convergence is uniform on $[0,\infty).$

To show uniform convergence I need to show that 
$$\lim_{n \to \infty} ||f_n - f||_{\infty} = 0$$
I see that
$$||f_n - f||_{\infty} = ||f_n - e^{-x}||_{\infty}$$
and that the maximum of $f_n(x)$ occurs at $x=n$ and thus
$$\lim_{n \to \infty} ||f_n - f||_{\infty} = ||e^{-x} - e^{-x}||_{\infty} = 0$$
showing uniform convergence.

(b) Compute $\int_{0}^{\infty} f(x)dx$ and $\lim_{n \to \infty} \int_{0}^{\infty} f_n(x)dx $. Why does this not contradict the Integral Convergence Theorem? 

First, I compute $\int_{0}^{\infty} f(x)dx$:
$$\int_{0}^{\infty} f(x)dx = \int_{0}^{\infty} e^{-x}dx = \lim_{t \to \infty} (1-e^{-t}) = 1$$
Now, for $\lim_{n \to \infty} \int_{0}^{\infty} f_n(x)dx $:
$$\lim_{n \to \infty} \int_{0}^{\infty} f_n(x)dx = \lim_{n \to \infty} \left ( \int_{0}^{n} f_n(x)dx + \int_{n}^{n+e^n} f_n(x)dx + \int_{n+e^n}^{\infty} f_n(x)dx \right ) = \frac{3}{2}.$$
I think that the Integral Convergence Theorem holds for continuous functions, and $f_n(x)$ is not continuous. Then I assume I should show that $f_n(x)$ is not continuous? Any input on my answers are welcomed.
 A: Some hints to possibly help:
For the first part, for any fixed $x$, once $n$ has gotten large enough (i.e., far enough along in the limit) what happens? The key here is that $f_n(x)$ is only one of the three piecewise parts, for any particular $x$, so you don't need to worry about all three pieces if, as you seem to have noticed, you always eventually land in the first piece.
For the uniform convergence, you would certainly have to justify why the maximum occurs there. I don't believe this to be true, and also, $f_n(n) \neq e^{-x}$ as you've written above?
I think I may see what you are trying to do. I believe that, perhaps, you think that the maximum of $f_n(x)$ being at $n$ (which it is not), means that the supremum of $f_n(x) - f(x)$ is maximized at $n$ as well? This is very much not true. What you need to do is find the supremum of the function $(f_n - f)(x)$, as a function of $n$, and then take the limit of this as $n\to \infty$.
For the last part, those not familiar with your course/book/notes/wherever this is coming from may not know explicitly what your Integral Convergence Theorem is, so may not know exactly where your contradiction isn't occurring (a quick Google shows theorems that are similar, but not the same, by that name). Either way, why do you think the $f_n$ aren't continuous? You may want to look a little closer at the bounds of integration to see where the problem lies...
