Differentiate under expectation sign. Let $f(x)$ be the probability density function of a $\text{Uniform}(0,1)$ distribution. Let $Z\sim\text{Normal}(0,1)$ and $g(x)=E[f(x+Z)]$. If one plots $g(x)$ in a computer, one observes like an asymetric bell shape.
We have that $f'=0$ exists except at two points, $0$ and $1$. But the probability that $x+Z$ belongs to $\{0,1\}$ is $0$. My question is why $g'(x)=E[f'(x+Z)]=0$ is not true. 
I think that one can use the dominated convergence theorem: fixed $x\in\mathbb{R}$, $f(x+Z)$ is differentiable at $x$ almost surely and $|f'(x+Z)|\leq 1$ almost surely. So the expectation and the differentiation should commute. What is wrong with this reasoning?
Edit: I write the use of the dominated convergence theorem more in detail: by definition of derivative, $$\lim_{h\rightarrow0} \frac{f(x+h+Z)-f(x+Z)}{h}=f'(x+Z).$$ By the mean value theorem, $$ \left|\frac{f(x+h+Z)-f(x+Z)}{h}\right|=|f'(x+\xi_h+Z)|\leq 1, $$ where $|\xi_h|<|h|$ and $E[1]=1<\infty$ (thus integrable). Then one uses the dominated convergence theorem, by interchanging the limit and the expectation. What is wrong here?
 A: The dishonest way to see why $g'(0)\ne0$ is to note that $f'(x)=\delta(x)-\delta(x-1)$ where $\delta$ is the Dirac delta function.
An honest way to use the DCT here is to dominate the difference quotients.  Which will be hard in your case, but possibly doable.
A way of sidestepping this problem is to rewrite your integral $g(x)=\int _{\mathbb R}f(x+z)\varphi(z)dz$ as $$g(x)=\int _{\mathbb R}f(z)\varphi(z-x)dz=\int_0^1\varphi(z-x)dz.$$
(Where $\varphi$ is the stadard Gaussian density function, of course.)  Now the difference quotient bounds are much easier to work with.
A: $$g'(x) = \lim_{h \to 0} \dfrac{g(x+h)-g(x)}{h} = \lim_{h \to 0} \mathbb E\left[ \frac{f(x+h+Z)-f(x+Z)}{h} \right]$$
For $h > 0$, $$f(x+h+Z)-f(x+Z) = \cases{1 & if $-x-h < Z < -x$\cr
                                        -1 & if $1-x-h < Z < 1-x$\cr
                                         0 & otherwise}$$
so $g'(x) = \lim_{h \to 0} h^{-1} (\mathbb P(-x-h<Z<-x)-\mathbb P(1-x-h<Z<1-x)) = \varphi(-x)-\varphi(1-x)$
where $\varphi$ is the density of $Z$.
