Let X and Y be random variables with joint pdf $f(x,y)=x+y$ for $0<x<1$ and $0<y<1$. Are X and Y independent? My heart says yes but my math says no. I am using the fact that $X$ and $Y$ are independent if and only if $f_X(x)f_Y(y)=f(x,y)$. So I have

$$f_{X}
(x)=\int_{0}^{1}f(x,y)dy\\=\int_{0}^{1}x+ydy\\=[xy+\frac{y^{2}}{2}]_{y=0}^{y=1}\\=x+\frac{1}{2}$$

and by basically exactly the same math, $f_Y(y)=y+\frac{1}{2}$. Then $$f_X(x)f_y(y)=(x+\frac{1}{2})(y+\frac{1}{2})=xy+\frac{1}{2}(x+y)+\frac{1}{4}\ne f(x,y)$$

And hence they are not independent. But can that be right? Why would the value of X have anything to do with the value of Y? It's not like one is a function of the other. 

Or have I made a simple mistake? I looked through a couple of times and I'm pretty sure my math is right...
Note that the conditional density f(x|y) depends on y.  f(x|y)=f(x,y)/f(y).  

You showed that f(y)=y+1/2 and f(x,y)=x+y.  So f(x|y)=(x+y)/(y+1/2) 

for any 0&lt;=x&lt;=1 and 0&lt;=y&lt;=1.

It clearly is not independent of y. So knowing y does addect the probability that X is in an fixed interval about x.
Your right. You can also check $E[XY]=E[X]E[Y]$ for the independence condition. This may be clearer because expected values are constant.
Also, independence is interpreted as that even if you know the outcome $X=x$, you cannot use that to guess $Y$: $f(Y|X)=f(Y)$.
For $f(x,y)=x+y$, if you know $X=x$, you have a better idea of what $Y$ will be.
For example, if $X=0.1$ or $X=0.5$, the probability of $Y=0.5$ under these two conditions are different.