Let $X$ be a smooth projective and irreducible curve and $P\in X$. I am asked to show that the dimension (as a $k$-vector space where $k$ is a algebraically closed field) of $\mathcal{O}_X(X-P)$ is infinite using the Riemann-Roch theorem. A curve over $k$ is defined as a quasi-projective variety all of whose irreducible components are of dimension one and the Riemann-Roch theorem states that $$\dim_kH^0(X,D)-\dim_kH^1(X,D)=1-g+\deg(D).$$ Where if we write $X=U\cup V$ for $U,V$ affine opens, $W:=U\cap V$, $D$ a divisor on $X$, and a map $\varphi:\mathcal{O}_X(D)(U)\oplus\mathcal{O}_X(D)(V)\to\mathcal{O}_X(D)(W)$ given by $\varphi(f,g)=f|_W-g|_W$. Then $H^0(X,D):=\text{ker}(\varphi)=\mathcal{O}_X(D)(X)$, $H^1(X,D):=\text{coker}(\varphi)$ and $\dim_kH^1(X,0)=g$.
I do not know where to start with this question. I suspect it has something to do with the canonical divisor since I probably have to recover $\mathcal{O}_X(X-P)$ using some divisor but even then I am completely lost.
By Riemann-Roch it suffices to show that for every $n$ the restriction map $H^0(X, \mathcal{O}(nP)) \to H^0(X \setminus \{P\}, \mathcal{O}_{X \setminus \{P\}})$ is injective.
This is well defined: rational functions in $H^0(X, \mathcal{O}(nP))$ only have poles at $P$ so their restriction to $X \setminus \{P\}$ are regular. Injectivity is just the fact that if a rational function vanishes on a nonempty open set, it vanishes everywhere.