joint PDF for two random variables Let $X$ and $Y$ have the joint PDF $f(x,y)=\frac{4}{3}(1-xy)$, $0<x<1$, $0<y<1$.
1) find $P(X<Y)$. 
2). Find the expectation of $X.$
For problem 1):
$P(X<Y)=P((X,Y) \in A)$, where $A=\{(x,y):x<y\}$,
\begin{align}  P(X<Y)= {} & \iint_A f(x,y) \,dx\,dy \\ = {} &\iint_{x<y} f(x,y) \,dx\,dy \\
= {} & \int_0^1 \int_0^y \frac{4}{3}(1-xy) \, dx \, dy \\
= {} & \int_0^1 \left[ \frac{4}{3} x- \frac{2}{3} x^2 y \right]^{x=y}_x = 0 \, dy \\
= {} & \int_0^1 \left( \frac{4}{3}y-\frac{2}{3}y^3 \right) \, dy \\ = {} & \frac{1}{2} \end{align}

Question 1: why we are treating y as from 0 to y while x from 0 to 1? Can we switch around, let y from 0 to 1 while x as 0 to x? 

2). We can compute the expectation of X in two ways, either by marginal PDF or by joint PDF. 

Question 2: I was told that unlike the discrete type, the continuous type need not have a joint PDF. But why can we compute using joint PDF in here?

 A: 
why we are treating $y$ as from $0$ to $y$ while $x$ from $0$ to $1$?

That is NOT being done:
$$
\int_0^1 \left( \int_0^y \frac{4}{3}(1-xy) \, dx\right) \, dy 
$$
In the iterated integral above, $x$ goes from $0$ to $y.$
It can also be written like this:
$$
\int_0^1 \left( \int_x^1 \frac 4 3 (1-xy)\, dy \right) \,dx
$$
In this case, $y$ goes from $x$ to $1.$
You have:
$$0\le x \le y \le 1.$$
That's the same as saying
\begin{align}
& 0 \le x \le 1 \\
\text{ and } & x\le y \le 1 \\[10pt]
\text{or } \\[10pt]
& 0 \le y \le 1 \\
\text{and } & 0\le x\le y. 
\end{align}
A: *

*Note that we are integrating $y$ from $0$ to $1$ and $x$ from $0$ to $y$.

*The joint pdf is given, so it exists and we can use it.  

A: 
Question 1: why we are treating x as from 0 to y while y from 0 to 1? Can we switch around, let x from 0 to 1 while y as 0 to x? 

The domain of integration is the intersection of $A$ and the support, which can be expressed in several equivalent ways. $$\begin{align}&\quad~\{\langle x,y\rangle: (0<x<1)\wedge (0<y<1)\wedge (x<y)\}\\&=\{\langle x,y\rangle: (0<x<y<1)\}\\&=\{\langle x,y\rangle: (0<y<1)\wedge (0<x<y)\}\\&=\{\langle x,y\rangle: (0<x<1)\wedge (x<y<1)\}\end{align}$$
So yes.$$\int_0^1\int_0^y\tfrac 43(1-xy)~\mathrm d x~\mathrm d y~=~\int_0^1\int_x^1\tfrac 43(1-xy)~\mathrm d y~\mathrm d x$$
[See also: Fubini's Theorem]

Question 2: I was told that unlike the discrete type, the continuous type need not have a joint PDF. But why can we compute using joint PDF in here?

Because you do have the joint PDF for this particular problem.   It exists and you know what it is.   Not only may you use it, it is infact the only thing that you can use.
(You need to use it to find the marginal and conditional pdf before you can use them.   Conserve energy; don't do unnecessary work.)

PS: I would also add that because of symmetry in the pdf, you did not need to integrate.   Clearly $\mathsf P(X<Y)=\mathsf P(Y<X)$.
