Effective divisors exactly those with global sections Let $X$ be a finite-type scheme over a field $k$. To an effective divisor $D$, there is a global section of the invertible sheaf $\mathcal{O}_X(D)$ (corresponding to the canonical morphism $\mathcal{O}_X \to \mathcal{O}_X(D)$). I've read somewhere that the opposite is true: if $H^0(X,\mathcal{O}_X(D)) \not= 0$, then there is an effective divisor $E$ with $\mathcal{O}_X(D) = \mathcal{O}_X(E)$ (i.e. $D$ and $E$ are linearly equivalent). 
If this is true, why?
And why wouldn't the following be a counterexample: let $X$ be an elliptic curve and $p,q,r \in X$ be distinct points, then $H^0(X,\mathcal{O}_X(p+q-r))$ is $1$-dimensional, but $p+q-r$ is not linearly equivalent to an effective divisor. 
 A: First of all you must assume more. Namely that a section corresponds to a monomorphism:
$$\mathcal{O}_X\rightarrow \mathcal{O}_X(D)$$
You may clearly get rid of this by assuming that $X$ is integral.
Then there is a bijection between set of such sections up to a scaling by $\Gamma(X,\mathcal{O}^*_X)$ and effective divisors linearly equivalent with $D$.  My answer below is given in the case of a the general ringed space, but you can read it assuming everywhere that $X$ is integral scheme.
Consider representation of $D$ given by a family $\{(U_i,f_i)\}_{i\in I}$, where $U_i\subseteq X$ is open and $f_i$ is a meromorphic(rational) function on $U_i$. Recall that $\mathcal{O}_X(D)$ is a subsheaf of the sheaf of meromorphic functions $\mathcal{K}_X$ on $X$ given as follows:
$${\mathcal{O}_X(D)}_{\mid U_i}=\mathcal{O}_{ U_i}\frac{1}{f_i}$$
Now a section of this sheaf given by monomorphism:
$$\mathcal{O}_X\rightarrow \mathcal{O}_X(D)$$
is the same as global invertible meromorphic function $f$ on $X$. For every $i\in I$ we can write:
$$f_{\mid U_i}=\frac{r_i}{f_i}$$ 
for some regular $r_i\in \mathcal{O}_X(U_i)$. Now $\{(U_i,r_i)\}_{i\in I}$ give rise to an effective divisor linearly equivalent to $D$. This is just because:
$$\frac{r_i}{f_i}=f_{\mid U_i}$$
so divisors $\{(r_i,U_i)\}_{i\in I}$ and $\{(f_i,U_i)\}_{i\in I}$ are linearly equivalent. This gives you a map in one direction. Reading argument backwards you may derive the map going into other direction.
A: If you happen to be in the situation where $X$ is a smooth projective variety over an algebraically closed field $k$, then we have the following bijection.
Let $|D|$ denote the set of effective divisors linearly equivalent to $D$. Then there is a bijection between $|D|$ and $\Gamma(X, \mathcal O(D)) -0$ mod $k^*$. If $E = D + (f)$, then $f \in \Gamma(X, \mathcal O(D)) -0$ (note any nonconstant multiple of $f$ will satisfy $E=D+(f)$ so we need to mod by $k^*$). Conversely if $f \in \Gamma(X, \mathcal O(D)) -0$, then $D+(f)$ is effective and clearly linearly equivalent to $D$. For the full details on when this is a bijection, see Hartshorne II.7.7.
In particular, $|D|$ is nonempty iff $\mathcal O(D)$ has a nonzero global section.
A: 
Effective Cartier divisors on a scheme are the same as invertible sheaves with fixed regular global section

See https://stacks.math.columbia.edu/tag/01X0.
