We prove a Lusin approximation of functions of bounded variation. If f is a function of bounded variation on an open set \(\Omega \subset X\) , where \(X=(X,d,\mu )\) is a given complete doubling metric measure space supporting a 1-Poincaré inequality, then for every \(\varepsilon >0\) , there exist a function \(f_\varepsilon \) on \(\Omega \) and an open set \(U_\varepsilon \subset \Omega \) such that the following properties hold true: (1) \(\textrm{Cap}_1(U_\varepsilon )<\varepsilon \) ;
(2) \(\Vert f-f_\varepsilon \Vert _{\textrm{BV}(\Omega )}< \varepsilon \) ;
(3) \(f^\vee \equiv f_\varepsilon ^\vee \) and \(f^\wedge \equiv f_\varepsilon ^\wedge \) on \(\Omega \setminus U_\varepsilon \) ;
(4) \(f_\varepsilon ^\vee \) is upper semicontinuous on \(\Omega \) , and \(f_\varepsilon ^\wedge \) is lower semicontinuous on \(\Omega \) .
If the space X is unbounded, then such an approximating function \(f_\varepsilon \) can be constructed with the additional property that the uniform limit at infinity of both \(f^\vee _\varepsilon \) and \(f^\wedge _\varepsilon \) is 0. Moreover, when \(X={{\mathbb {R}}}^d\) , we show that the non-centered maximal function of \(f_\varepsilon \) is continuous in \(\Omega \) .