A discontinuous almost everywhere map does not admit an invariant measure Let's consider a map $T: X \rightarrow X$ so that it's discontinuous almost everywhere (in particular, let $X = \mathbb{R}$, and $T = 1_{\mathbb{Q}}$ -- Dirichlet function). Is it true that $T$ does not admit an invariant measure (e.g. $\lambda(X) = \lambda(T^{-1}(X))$)? 
The original problem is to find a map from $3$-dimensional ball to itself with the given property. Bogolybov-Krylov theorem states that for every compact space $X$ and for every continuous $T$ such measure does exist. So, it's reasonable to look for a very "bad" maps, such as considered before. 
 A: In short: Even if your function is discontinous almost everywhere, it still can possess an invariant measure.

First of all, I belive that in order to pose your question correctly one needs a measurable space $(X,\Sigma)$, then one can ask if a measure $\lambda : \Sigma \to [0,\infty] $ exists with
$$ \lambda(A) = \lambda(T^{-1}(A)) $$
for all $A \in \Sigma$. 
For the case that one has no requirements on $X$ and $\Sigma$ is not pre-definied, one can simply set $\Sigma := \{ \emptyset, X\}$  and define the measure $\lambda(\emptyset):=0$, $\lambda(X):=1$, this would be invariant for any function $T : X \to X$.
For the case where $X=\mathbb{R}$ is given with an $\sigma$-algebra $\Sigma$ such that $T(x) = 1_{\mathbb{Q}}(x)$ is measurable, one can simply define the Dirac measure
$$ \lambda(A) = \begin{cases} 1,& \text{if }1 \in A, \\ 0,& \text{else}.\end{cases} $$
To see that this measure is invariant according to $T$, note that
$$ T^{-1}(A) = \begin{cases} \mathbb{Q}, & 1 \in A, \, 0 \notin A, \\ \mathbb{R} \backslash \mathbb{Q}, & 1 \notin A, \, 0 \in A, \\ 
\mathbb{R},  & 1 \in A, \, 0 \in A, \\ \emptyset,  & 1 \notin A, \, 0 \notin A, \\    \end{cases} $$ and thus
$$ \lambda(T^{-1}(A)) = \begin{cases} 1, & 1 \in A, \, 0 \notin A, \\ 0, & 1 \notin A, \, 0 \in A, \\ 
1,  & 1 \in A, \, 0 \in A, \\ 0,  & 1 \notin A, \, 0 \notin A, \\    \end{cases} = \begin{cases} 1,& \text{if }1 \in A, \\ 0,& \text{else}.\end{cases} = \lambda(A). $$
The solution is intuitive: If you start in 1, then you remain there.
A: Given a continuous map $T: X \to X$ where $X$ is compact and Hausdorff with no isolated points, and a  countable dense subset $S$ of $X$, you can make $T$ continuous nowhere by changing $T$ on $S$.  Divide $S$ into two disjoint subsets $S_1, S_2$ that each are dense in $X$.  Choose two distinct points $p, q \in X \backslash S$, and 
define
$$ \widetilde{T}(x) = \cases{ T(x)& if  $x \notin S$\cr p & if $x \in S_1$\cr q & if $x \in S_2$}$$
 Any nonatomic measure that is invariant for $T$ is still invariant for $\widetilde{T}$, because $\widetilde{T}^{-1}(A)$ and $T^{-1}(A)$ differ at most on a countable set.
If $T$ has an invariant measure $\lambda$ that is not nonatomic, you can ensure it is still invariant for $\widetilde{T}$ by choosing $S$, $p$, $q$ so that 
$\lambda(S \cup \{p,q\}) = 0$. 
