Interchanging Derivative and Integral Example In class the other day, my professor stated the following theorem:

Suppose $\frac{d}{dy}f(x,y)$ is continuous on $[0,1] \times [0,1]$, then $\frac{d}{dy} \int^1_0 f(x,y) \, dx = \int_0^1 \frac{d}{dy}f(x,y) \, dx$.

He then quickly corrected this to read:

Suppose $\frac{d}{dy}f(x,y)$ and f are continuous on $[0,1] \times [0,1]$, then $$\frac{d}{dy} \int^1_0 f(x,y) \, dx = \int_0^1 \frac{d}{dy}f(x,y) \, dx.$$

I was wondering if anyone could provide an example of $f$ which satisfies the conditions for the first statement written but not the subsequently added continuity condition from the second statement, and therefore fails the overall implication of the first statement.
 A: Let $\mathbb{Q}$ be the set of rational numbers. Define $f:[0,1]^2 \to \mathbb{R}$ by 
$$f(x,y) = \chi_{\mathbb{Q}}(x)= \begin{cases} 1 & x \in \mathbb{Q}\cap[0,1] \\ 0 & x \in [0,1] \setminus \mathbb{Q} \end{cases},$$
i.e., $f(x,y)$ is $1$ if $x$ is rational and $0$ if $x$ is irrational. 
Then $\frac{\partial f}{\partial y} \equiv 0$ and is therefore continuous ($f$ is constant with respect to $y$). As such, 
 $$\int_0^1 \frac{\partial f}{\partial y} ~\mathrm{d} x =0.$$
However, the integral term in 
$$\frac{d}{dy} \int_0^1 f(x,y)~\mathrm{d}x$$
is not even defined. Well, at least for the Riemann Integral$\dots$
A: Implicit in the first statement is the existence of all integrals.
As long as $x \mapsto f(x,y)$ is integrable for each fixed $y$, then it is sufficient for $f_y$ to be continuous on $[0,1]^2$ to justify differentiating under the integral sign.
With 
$$F(y) = \int_0^1 f(x,y) \, dx$$
and $y_0 \in [0,1]$, we have for $y \neq y_0$,
$$\left|\frac{F(y) - F(y_0)}{y - y_0} - \int_0^1 f_y(x,y_0) \, dx\right| = \left|\int_0^1 \left(\frac{f(x,y)- f(x,y_0)}{y - y_0} - f_y(x,y_0) \right) \, dx\right|.$$
Applying the mean value theorem there exists $\xi$ (which may depend on $x$) between $y$ and $y_0$ such that
$$\left|\frac{F(y) - F(y_0)}{y - y_0} - \int_0^1 f_y(x,y_0) \, dx\right| = \left|\int_0^1 \left(f_y(x, \xi) - f_y(x,y_0) \right) \, dx\right| \\ \leqslant \int_0^1 \left|f_y(x, \xi) - f_y(x,y_0) \right| \, dx.$$
By uniform continuity of $f_y$ on the compact set $[0,1]^2$ there exists for any $\epsilon > 0$ a $\delta > 0$ such that $|y - y_0| < \delta $ implies $|f_y(x, \xi) - f_y(x, y_0)| < \epsilon$ and
$$\left|\frac{F(y) - F(y_0)}{y - y_0} - \int_0^1 f_y(x,y_0) \, dx\right| < \epsilon,$$
proving that $F'(y_o) = \int_0^1 f_y(x,y_0) \, dx.$
There is no counterexample that you seek.
In fact, the switch is valid under much weaker conditions. Considering the Lebesgue integral, for example, if $x \mapsto f(x,y)$ is measurable for each $y$ and integrable for at least one $y$,$f_y(x,y_0)$ exists and there exists an integrable function $g$ such that for $x , y \in [0,1]$ and $y \neq y_0$
$$\left|\frac{f(x,y) - f(x,y_0)}{y - y_0}\right| \leqslant g(x)$$
Perhaps, a simple example might convey some intuition why continuity of $f$ itself is not needed.
Take 
$$f(x,y) = \begin{cases} 1 + y, \,\,\, 0 \leqslant x \leqslant 1/2, \, 0 \leqslant y \leqslant 1 \\ 2 + y, \,\,\, 1/2 < x \leqslant 1, \, 0 \leqslant y \leqslant 1\end{cases}$$
Then $f_y(x,y) = 1$,  
$$F(y) = \int_0^1 f(x,y) \, dx = \frac{3}{2} + y,$$
and
$$F'(y) = 1 = \int_0^1 f_y(x,y) \, dx$$
