In Durrett's Probability Theory and Examples https://services.math.duke.edu/~rtd/PTE/PTE4_1.pdf, he gives the following.
I have two questions:
- how do we get the underlined line?
- We apply Jensen's inequality, but how do we know that we have convexity?

Recall that
$$\mathbb{E}g(X) = \sum_{m=0}^N \mathbb{P}(X=x_m) g(x_m)$$
for any discrete random variable $X$ taking values in $\{x_0,\ldots,x_N\}$. Applying this formula to $X := S_n$ and $g(x) := f(x/n)$ we find
$$\mathbb{E}f(S_n/n) = \sum_{m=0}^n \mathbb{P}(S_n=m) f(m/n) = \sum_{m=0}^n {n \choose m} p^m (1-p)^{n-m} f(m/n)=f_n(p).$$
Regarding your second question: Durrett is using Jensen's inequality for the convex function $g(x) := |x|$, i.e. he is using that
$$|\mathbb{E}(Y)| \leq \mathbb{E}(|Y|)$$
for
$$Y:= f \left( \frac{S_n}{n} \right)-f(p).$$