I have a very silly question if you could clear it quickly that would be great. Thank you.
If a dynamical system on the state-space $X$ is both measure-preserving and ergodic and let us assume $\mu(X)=1$, then for almost all $x\in X$ $$\lim_{n\to \infty}\frac{1}{n}\sum\limits_{k=0}^{n-1}1_{A}(T^{k}x)\to \mu(A).$$
Now since the dynamical system is ergodic then from the definition of an ergodic dynamical system we get that for any $A$ with $T^{-1}(A)=A$ then $ \mu(A)=0$ or $1$. So In the above limit if $0<\mu(A)<1$ then clearly $T^{-1}(A)\ne A$ right?
You have the definition of ergodicity wrong- Only if $A=T^{-1}(A)$ (or if the difference set has measure zero) can you conclude that $\mu(A)\in \{0,1\}$.