$R/(ab)\cong R/(a)\oplus R/(b)$, for $a$ and $b$ non-associate irreducible 
Let $a,b$ be non-associate irreducible elements in UFD $R$. Then 
   $$R/(ab)\cong R/(a)\oplus R/(b)$$

What is the isomorphism function I have to define?
Does $f(r+(ab))=(r+(a),r+(b))$ works here? If yes, how to show it is surjective?
I also need to understand something, Why do we need UFD?

I don't think this true is without requiring that $R$ be a PID. Consider the example $R = \mathbb{Z}[X]$ and $a = 2, b = X$. Then the statement would imply $\mathbb{Z}[X]/(2X) \cong \mathbb{Z} \oplus \mathbb{F}_{2}[X]$. The latter ring has four idempotent elements, namely $(0, 0), (1, 0), (0, 1)$ and $(0, 0)$. The former ring, however, has only trivial idempotents by degree arguments (the square of any nonconstant polynomial with an odd leading coefficient also has an odd leading coefficient of higher degree). 
