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.
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.