$R$ is a UFD iff $R_{\frak{m}}$ is a UFD? Let $R$ be a graded ring such that $R_0$ is a field and let $\frak{m}$ be the maximal ideal generated by all the elements of positive degree. Then, is it true that $R$ is a UFD iff $R_{\frak{m}}$ is a UFD?
If not, then what would be an example of $R_{\frak{m}}$ being a UFD, but $R$ NOT being a UFD?
It'll be nice if the counterexample, if there exists one, is of a ring which is a quotient of a polynomial ring in finitely many variables, over algebraically closed field.
 A: (Note: The original question had an incorrect premise.  The ideal generated by elements of positive degree in an arbitrary graded ring is not generally maximal.)
Here is the solution to the original problem: Let $R=\mathbb{Z}+x\mathbb{Q}[x]$.  This is an $\mathbb{N}$-graded ring, where  grade-$0$ is $\mathbb{Z}$, and grade-$n$ with $n\geq 1$ is $\mathbb{Q}x^n$.
This ring is is not a UFD, since $x=2(2^{-1}x)=2^2(2^{-2}x)=\cdots$ shows that $x$ is infinitely divisibly by the irreducible element $2$.
Letting $\mathfrak{m}$ be the ideal generated by all elements of positive grade, then $R_{\mathfrak{m}}$ is the subring of $\mathbb{Q}(x)$ where the constant term of the polynomial in the denominator is nonzero, which is a UFD.  (Up to a unit multiple, every nonzero element is a unique nonnegative power of $x$.)
A: The following are just some partial thoughts about the new question which are too long for comments.  Throughout, assume that $R_{\mathfrak{m}}$ is a UFD, $R_0$ is a field, etc...
First, let $x\in \mathfrak{m}$ be homogeneous, and irreducible in $R$; we will prove that $x$ remains irreducible in $R_{\mathfrak{m}}$.  If not, then after clearing denominators we can write $(1+s)x=yz$ for some $s,y,z\in \mathfrak{m}$.  Let $y_m$ and $z_n$ be the leading terms (i.e., the nonzero components of smallest grade) in $y$ and $z$ respectively.  Then the homogeneity of $x$ forces $x=y_mz_n$.  Since $m,n\geq 1$, we see that $y_m$ and $z_n$ are not units, which contradicts the irreducibility of $x$ in $R$.
Second, let's prove that such an $x$ is prime in $R$.  Suppose that $x|(yz)$ for some $y,z\in R$, and further suppose by way of contradiction that $x$ doesn't divide $y$ nor $z$.  Let $y_m$ and $z_n$ be the smallest components of $y$ and $z$ (respectively) that $x$ doesn't divide.  The grade $m+n$ component of $yz$ is $\sum_{i,j\, :\, i+j=m+n}y_i z_j$.  By the homogeneity of $x$, we know that it divides each component of $yz$, and in particular it divides this sum.  By the minimality on $m$ and $n$, we know that it divides each term where $(i,j)\neq (m,n)$.  Hence it divides $y_m z_n$.  So, we reduce to the case that $y$ and $z$ are homogeneous.
Now, write $y$ and $z$ as products of irreducibles of $R$ (such factorizations exist by degree arguments), none of which is an $R$-associate of $x$.  As $y$ and $z$ are homogeneous, all of these irreducibles are homogeneous.  Thus, these irreducibles stay irreducible in $R_{\mathfrak{m}}$, which is a UFD.  So, one of these irreducibles, say $x'$, must be $R_{\mathfrak{m}}$-associate to $x$.  After clearing denominators, this means $(1+s)x=c(1+t)x'$ for some $s,t\in \mathfrak{m}$ and some $c\in R_0$.  Looking at leading terms, this means $x=cx'$, contradicting the fact that $x$ and $x'$ are not $R$-associates.
A: Note: the claim in this answer that $R$ is graded is wrong, I leave it here for the record until popular opinion requests for me to remove it (David Lampert)
Here is a counterexample.
$R=\mathbb{Q}[x,y_1,y_2,y_3,...]/(y_1^2-1-x,y_2^2-y_1,y_3^2-y_2,...).$
There is an embedding $R \subset \mathbb{Q}[[x]]$ defined by power series expansions which gives $R$ a grading with $m=(x,y_1-1,y_2-1,y_3-1,...).$  Note:  this is wrong, see commments below.
$R$ is not a UFD: there is no irreducible element dividing the non-unit $y_1$.
$R_m$ is a UFD: (1) Every non-unit is a product of irreducibles since each $y_n$ is a unit in $R_m$; (2) If an irreducible divides a product then it does so in some $\mathbb{Q}[y_n, y_n^{-1}]$ which is a UFD.
A: $\DeclareMathOperator{\mmm}{\mathfrak{m}}\DeclareMathOperator{\nn}{\mathbb{N}}$This is a partial answer. Assuming $R$ is $\nn$-graded, $R_0$ is a field, and $R_{\mmm}$ is a UFD, we show that every element of $R$ can be represented as a product of irreducible elements.
First, it is easy to see that $\mmm$ does not have a zero divisor. It follows that if $f = gh$, then $\deg(f) = \deg(g) + \deg(h)$, and since nonnegative integers can not indefinitely decrease, every element in $R$ can be expressed as a finite product of elements which satisfy the following property, call it $(*)$:

it can not be represented as a product of elements with smaller degree.

Any element satisfying $(*)$

*

*either has degree zero, in which case it is a unit, or

*if represented by a finite product, then all but one of the multiplicands must have degree zero (due to additivity of degree) and hence units.

It follows that any element satisfying $(*)$ is irreducible. It remains to show that the decomposition is unique. Initially I thought that it follows from additivity of degree and non-existence of zero-divisors, but Pace Nielsen gave a great counterexample in the comments.
Edit: The following argument is incorrect, as pointed out by Pace Nielsen in the comments.
We now prove a weaker statement that every decomposition of an element has the same number of irreducible (non-unit) elements.
Indeed, let $f = \prod_{i=1}^m g_i = \prod_{j = 1}^n h_j$ such that the degree of each $g_i$ and $h_j$ are positive. Then $\prod_{i=1}^m g_{i,d_i} = \prod_{j=1}^n h_{j,e_j}$, where $g_{i,d_i}$ and $h_{j,e_j}$ are the highest degree homogeneous components of respectively $g_i$ and $h_j$. Now the lemma below implies that each $g_{apply the assumption that $R_{\mmm}$ is a UFD to see that $m = n$, and moreover, after a reordering if necessary, $g_{i,d_i} = h_{i,e_i}$ for $i = 1, \ldots, m$.
