It's easy to prove that $L_{p}(K)$ is separable , using Stone theorem. But how can we show the same result for real line ?
I thought about considering : $ \mathbb{R} = \cup (a_i , b_i] $ and $\mathbb{1}((a_i , b_i])$. But my teacher said that they are not in $L_{p}$.
You have more or less the right idea, but the problem is that $1_{\mathbb R}$ does not lie in $L_p(\mathbb R)$ because $\mathbb R$ has infinite Lebesgue measure. Instead consider indicators of finite intervals $1_{[a,b]}$ with rational endpoints, to $a,b \in \mathbb Q.$ If $\mathcal{Q} \subset L_p(\mathbb R)$ is the set of all such indicator functions, we claim that, $$ V := \overline{\operatorname{span}} \mathcal{Q} = L_p(\mathbb R).$$ Indeed if this holds, we can show the set of rational linear combinations in dense, which in turn proves separability.
The key step lies in showing that $1_A \in V$ for any $A \subset \mathbb R$ (Lebesgue) measurable with finite measure. The added condition is important, because $1_A \not\in L_p(\mathbb R)$ is $A$ has infinite measure. To show this, for each $k \in \mathbb Z$ consider, $$ \mathcal{D}_k = \left\{ A \subset [k,k+1] : A \text{ measurable and}\ 1_A \in \overline{\operatorname{span}}\mathcal{Q_k}\right\},$$ where $\mathcal{Q_k} \subset \mathcal{Q}$ contains all functions in $\mathcal{Q}$ supported in $[k,k+1].$ One can show using the Dynkin $\lambda-\pi$ lemma that each $\mathcal{D}_k$ contains all measurable subsets of $[k,k+1].$ Hence by monotone convergence we get $1_A \in V$ for all $A \subset \mathbb R$ measurable with finite measure.
To conclude the argument, pick $f \in L_p(\mathbb R)$ and write $f = f_+ - f_-,$ where $f_+ = \max\{f,0\}$ and $f_- = \max\{-f,0\}.$ It suffices to show we can approximate both in $L_p$ by elements in $V,$ so wlog assume $f \geq 0$ almost everywhere. Then we can find a sequence of simple functions $f_n$ such that $f_n \rightarrow f$ pointwise monotonically. By monotone convergence, $f_n \rightarrow f$ in $L_p(\mathbb R)$ and hence $f \in V.$