Derive the marginal probability function for X Question:
Suppose $X$ and $Y$ are discrete random variables with the following joint distribution:
$P_{XY}(X=x_i, Y=y_j)=\dfrac{1}{n^2}, \,\,\,\, x=1, 2, ...., n \,\,\,\, y=1,2,...n$
Derive the marginal probability function for $X$.
The marginal probability mass function of $X$, denoted by $p_X(x)$ for discrete random variables is given by
$p_X(x)=\sum_y p(x,y)$
Keeping $x$ fixed in the first formula means that we are summing all entries of the $x$-row. 
Attempt:
Am I right to approach it this way? 
$p_X(x)=\int_1^n \dfrac{1}{n^2} \,\,dy$
$=\dfrac{1}{n^2}y\Big|^n_1=\dfrac{1}{n}-\dfrac{1}{n^2}=\dfrac{n-1}{n^2}$
Same with the marginal value for y.
Update:
B. Derive the conditional probability function for $X$.
Generally speaking, conditional=joint/marginal. (marginal=unconditional)
$$P(X=x|Y=y)=\dfrac{P(X=x,Y=y)}{P(Y=y)}=\dfrac{p(x,y)}{p_Y(y)}$$
We first find marginal probability function for $Y$, $P(Y=y)$. As in the previous section, when we are adding up $n$ copies of $\dfrac{1}{n^2}$, we get $\dfrac{1}{n}$ since $n\times\dfrac{1}{n^2}=\dfrac{n}{n^2}=\dfrac{1}{n}$. It follows that $Pr(Y=y)=\dfrac{1}{n}$ if $y$ is an integer in the interval from 1 to $n$, or $0$ elsewhere. The distribution of $Y$ is discrete uniform. Now, $$P(X=x|Y=y)=\dfrac{p(x,y)}{p_Y(y)}=\dfrac{1/n^2}{1/n}=\dfrac{1}{n}$$
C. Are X and Y independent?
$X$ and $Y$ are independent if for all $(x,y)$, $$p(x,y)=p_X(x)p_Y(y)$$
Does that sound about right?
Since $$\dfrac{1}{n^2}=\dfrac{1}{n}\times \dfrac{1}{n}$$
we conclude, $X$ and $Y$ are independent. 
Update 2:


*

*What is $E(X)$? 


If the marginal probability distribution of $X$ has the probability mass function $f_X(x),$ then 
$$E(X)=\sum_R xf_{XY} (x,y)$$
Thus, 
$$E(X)=\sum_R x\dfrac{1}{n^2}=\dfrac{xn}{n^2}=\dfrac{x}{n}$$


*What is $E(X\big | Y=1 )$?


$$E(X\big | Y=1 )=1$$


*What is $E(X+Y)$?


$$E(X+Y)=E(X)+E(Y)= \dfrac{2x}{n}$$


*What is $E(XY)$?
$$E(XY)=E(X)E(Y)=\dfrac{x}{n}\times \dfrac{x}{n}=\dfrac{x^2}{n^2}$$

 A: The random variables $X$ and $Y$ are discrete, not continuous. It is not integration, it is summation. For any fixed integer $x$ between $1$ and $n$, find the sum
$$\sum_{y=1}^n p(x,y).$$
Added: OP has added more calculations to the post. We deal with some of the work.  By using the answer above, we can see that $\Pr(X=x)=\frac{1}{n}$ for $x=1,2,3,\dots, n$.
Now we want $E(X)$. for this, we could use the original joint distribution function, but it is clearer to use the (marginal) distribution of $X$.
We have
$$E(X)=1\cdot\Pr(X=1)+2\cdot \Pr(X=2)+\cdots+n\cdot \Pr(X=n).$$
Thus 
$$E(X)=\frac{1}{n}\left(1+2+3+\cdots+n\right).$$
But the sum of the first $n$ positive integers is $\frac{n(n+1)}{2}$. It follows that
$$E(X)=\frac{n+1}{2}.$$
(There are other ways to find this result, but we chose to use "formulas.")
The next question asks for $E(X|Y=1)$. We could find the conditional distribution of $X$ given $Y=1$. But it is easier to use the result (proved by OP) that $X$ and $Y$ are independent. Thus $E(X|Y=1)=E(X)=\frac{n+1}{2}$.
For the last two problems, the method used by OP is correct. We have $E(X+Y)=n+1$ and (by independence) $E(XY)=E(X)E(Y)=\frac{(n+1)^2}{4}$.
