Is there a function defined on real numbers which is continuous from the left, but not from the right, everywhere I am teaching Mathematical analysis. A student asked this question. I think this is a good question, but don't know the answer.
 A: Let $\omega(f,A):= \sup \{|f(x)-f(y)| : x,y \in A\}$ be the oscillation of $f$ on $A$, and let $O_n$ be the union of all open sets $A$ s.t. $\omega(f,A) < 1/n$. Then $O_n$ is open and its complement is countable because every uncountable closed set contains a point that is a limit point from the left of the set, while for every real $x$ there is a $y<x$ s.t. $(y,x)$ is a subset of $O_n$. The function $f$ is continuous at points of $B:=\cap O_n$, and the complemented of $B$ is countable.
A: Any left-continuous function $f \colon \mathbb{R} \to \mathbb{R}$ is continuous almost everywhere.
To see this, consider for instance $f$ on $[0,1]$. (Note that left-continuous functions are Borel.) Take $\epsilon >0$ and for each $n \in \mathbb{N}$ a $\delta_n>0$ such that
$$\mathcal{L}(A_n) \ge 1-2^{-n}\epsilon$$
with
$$A_n := \left\{x \in [0,1]\,:\, |f(x)-f(y)|<\frac1n \text{ for all }y \in (x-\delta_n,x)\right\}.$$
Then $f$ is clearly continuous at the density-points of $\bigcap_{n \in \mathbb{N}} A_n$.
A: Here's an elementary construction that may be more digestable by your student. 


*

*By definition of left continuity, for every point $x$ and every $\epsilon > 0$ there exists $\delta > 0$ such that if $y\in (x-\delta,x)$, $|f(y)-f(x)| < \epsilon$. We can upgrade this by the triangle inequality to for every $y_1,y_2\in (x-\delta,x)$, $|f(y_1) - f(y_2)| < 2 \epsilon$. 

*Now we construct a sequence of points $x_i$ as follows. Let $\epsilon_i = 2^{-i}$ be fixed. Let $x_1$ be arbitrary, and $\delta_0 = 1$. Given $x_k$, we define $\tilde{\delta}_k$ be that which is given by step 1. And we define $$\delta_k = \min(\tilde{\delta}_k, \frac13 \delta_{k-1})$$
And we let $x_{k+1} = x_k - \frac13 \delta_k$. 

*Let $z = \lim x_k$. Note that $z < x_k$ for all $k$ and $\frac13 \delta_k < x_k - z < \frac23 \delta_k$, so by construction we have that whenever $y \in (z - \frac13 \delta_k, z+\frac13\delta_k)$ we have $|f(x) - f(y)| < 2^{1-k}$. This shows continuity of $f$ at $x$. 
