In the first part of the paper, we study reflected backward stochastic differential equations (RBSDEs) with lower obstacle which is assumed to be right upper-semicontinuous but not necessarily right-continuous. We prove existence and uniqueness of the solutions to such RBSDEs in appropriate Banach spaces. The result is established by using some tools from the general theory of processes such as Mertens decomposition of optional strong (but not necessarily right-continuous) supermartingales, some tools from optimal stopping theory, as well as an appropriate generalization of Ito's formula due to Gal'chouk and Lenglart. In the second part of the paper, we provide some links between the RBSDE studied in the first part and an optimal stopping problem in which the risk of a financial position $\xi$ is assessed by an $f$-conditional expectation $\mathcal{E}^f(\cdot)$ (where $f$ is a Lipschitz driver). We characterize the value function of the problem in terms of the solution to our RBSDE. Under an additional assumption of left upper-semicontinuity on $\xi$, we show the existence of an optimal stopping time. We also provide a generalization of Mertens decomposition to the case of strong $\mathcal{E}^f$-supermartingales.