Convergence in distribution of random variable given its distribution $X_n$ is a seq of r.v.'s with pdf $p_n(x)=$ $\frac{n}{2}$ $\mathbb{1}(x)$ $_{[0, n^{-1}]}$ $+$ $\frac{1}{2}$ $\mathbb{1}(x)_{[1+n^{-1},2+n^{-1}]}$
Check if $X_n$ is convergent in distribution, and if it is find its limit distribution. 
So from the definition of weak convergence we have $X_n$ converges weakly to $X$ if $\mathbb{E}(f(X_n)$ $\to$ $\mathbb{E}f(X)$ for every bounded $f$.
I claim $X_n$ is convergent in distribution, but it looks like the definition of weak convergence is not to useful for proving it.
I cannot check every possible $f$. 
What should I do then? How do you solve this types of problems when you are given the density function explicitly? Most of the problems I encountered are to prove something genetal for $X_n$ when you already know it is  convergent in distribution.
 A: To show that $X_n$ converges in distribution to $X$, it suffices to show that $F_n(t)\to F(t)$ for all $t$ such that $F(t)$ is continuous, where $F_n(t)$ is the distribution function of $X_n$ and $F$ the distribution function of $X$. First we compute the distribution function of $F_n$: for $0<t<n^{-1}$ we have
$$
F_n(t) = \mathbb P(X_n\leqslant t) = \int_0^t \frac n2\ \mathsf dt =\frac n2t.
$$
For $n^{-1}<t<1+n^{-1}$, the density is zero, so again $F_n(t) = \frac n2t$.
For $1+n^{-1}<2+n^{-1}$ we have
\begin{align}
F_n(t) &= \int_0^{2+n^{-1}} f_n(t)\ \mathsf dt\\ &= \int_0^{n^{-1}} f_n(t)\ \mathsf dt + \int_{1+n^{-1}}^t f_n(t)\ \mathsf dt\\
&= \frac 12 + \int_{1+n^{-1}}^t \frac12\ \mathsf dt\\
&= \frac12 + \frac12(t - (1+n^{-1})).
\end{align}
For $0<t<n^{-1}$ it follows that
$$
F_n(t) = \frac n2t\mathsf 1_{(0,n^{-1})}(t) \stackrel{n\to\infty}\longrightarrow 0.
$$
For $n^{-1}<t<1+n^{-1}$ it follows that
$$
F_n(t) = \frac12\mathsf 1_{(n^{-1},1+n^{-1})}(t) \stackrel{n\to\infty}\longrightarrow\frac12.
$$
For $1+n^{-1}<2+n^{-1}$ it follows that
$$
F_n(t) = \left(\frac12 + \frac12(t - (1+n^{-1}))\right)\mathsf 1_{(1+n^{-1},2+n^{-1})}(t) \stackrel{n\to\infty}\longrightarrow \frac12 t.
$$
Putting this together, we have
$$
F(t) = \frac12\mathsf 1_{[0,1)}(t) + \frac12t\mathsf 1_{[1,2)}(t) + \mathsf 1_{[2,\infty)}(t).
$$
