To refresh your memory, this falls under order statistics in probability theory.
Let $X_i$ be a random variable that represents a roll. We can write the maximum as $X_{\max} = \max\{X_1, X_2, X_3, ... X_N\}$
Let's use the CDF of $X_{\max}$ to find the PDF of $X_{\max}$
$$F_{X_{\max}} = P(X_{\max} \leq x)$$
This is the same thing as asking, what is the probability that every die rolled is less than or equal to $X_{\max}$. Since these are iid, we have:
$$F_{X_{\max}}(x) = P(X_{\max} \leq x) = P(X_1\leq x)P(X_2\leq x)...P(X_N\le x)$$
If the dice aren't the same, you'd have to compute each of the CDFs independently, and continue to the next step. Since they are the same, we have that $F_{X_\max}(x) = P_1(X_1 \leq x)^N=x^N/20^N.$
The PMF is now just the difference between $F(x) - F(x-1)$. In this case that's:
$$p(X_\max=x) = {x^N-(x-1)^N \over 20^N}$$
To find the expected value, we just take a weighted sum over the possible rolls
$$ E[X_\max] = \sum_{x=1}^{20}x{x^N-(x-1)^N \over 20^N}$$
You can use similar reasoning to find the expectation of the minimum.