The definition of weak convergence of random variables is as follows:
Let $C_b(\mathbb{R}^d)$ be a functional space containing continuous and bounded functions from $\mathbb{R}^d$ to $\mathbb{R}$. Given a sequence of random variables ($X_n$) and $X$ on a probability space $(\mathbb{R}^d, \mathcal{B}(\mathbb{R}^d), \mathbb{P})$. $(X_n)$ converges weakly to $X$, denoted by $X_n \xrightarrow{(d)} X$, if $\forall \phi \in C_b(\mathbb{R}^d)$, $\mathbb{E}[\phi(X_n)] \rightarrow \mathbb{E}[\phi(X)].$
I would like to show that continuous and bounded are two necessary conditions for test function $\phi$. Given $X_n \xrightarrow{(d)} X$, find a test function $\phi$ which is not continuous (or unbounded) such that $\mathbb{E}[\phi(X_n)] \nrightarrow \mathbb{E}[\phi(X)].$
I've come up with an example for one case. Consider $X_n \sim Unif(\{ \frac{k}{2^n} | 1 \leq k \leq 2^n \})$. By Riemann sum approximation, $X_n \xrightarrow{(d)} X \sim Unif([0,1])$. Let $\phi(x)= 1*\unicode{x1D7D9}_{\{\mathbb{Q} \cap [0,1]\}}(x) + 0*\unicode{x1D7D9}_{\{(\mathbb{Q} \cap [0,1])^c\}}(x)$ be a bounded but discontinuous function from $\mathbb{R}$ to $\mathbb{R}$. After calculation by the definition of expectation, we have $\mathbb{E}[\phi(X_n)] \rightarrow 1$ as $n \rightarrow \infty$ but $\mathbb{E}[\phi(X)] = 0$.
However, I have no idea about constructing a continuous but unbounded $\phi$ such that $\mathbb{E}[\phi(X_n)] \nrightarrow \mathbb{E}[\phi(X)]$ given $X_n \xrightarrow{(d)} X$.
Are there any examples for this case? Thanks!