Prove that for all $f: \mathbb R \rightarrow \mathbb R $, $i_{\mathbb R}Rf$ iff $f$ is one-to-one. 
Let $\mathcal F = \{f \mid f : \mathbb R \rightarrow \mathbb R\}$ and
   define relationship $R$ on $\mathcal F$ as follows:
$$R = \{(f,g) \in \mathcal F \times \mathcal F \mid \exists h \in  \mathcal F (f = h \circ g)\}$$
Prove that for all $f \in \mathcal F$, $i_{\mathbb R}Rf$ iff $f$ is
  one-to-one.

$$i_{\mathbb R} = \{(x,x) \mid x \in \mathbb R\}$$
My attempt:
$(\rightarrow)$
Suppose $i_{\mathbb R}Rf$. Exists function $h \in F$, such that 
$$i_{\mathbb R} = h \circ f $$
Suppose $(x,a_1) \in f$ and $(x,a_2) \in f$
Since $a_1,a_2 \in \mathbb R$ and $h: \mathbb R \rightarrow \mathbb R$, there exist $b_1,b_2 \in \mathbb R$ such that $(a_1,b_1) \in h$ and $(a_2,b_2) \in h$
Then we have $(x,b_1) \in i_{\mathbb R}$ and  $(x,b_2) \in i_{\mathbb R}$, which means that $b_1 = b_2$ 
Since $h$ is a function, $a_1 = a_2$
$(\leftarrow)$
Suppose $f$ is one-to-one. Define $f^{-1}$ as 
$$f^{-1} = \{(y,x) \mid (x,y) \in f\} $$
Then $f^{-1} \circ f = i_{\mathbb R}$, and thus $i_{\mathbb R}Rf$
$\Box$

Is it correct?

The only problem that I see is that you have assumed that $f^{-1}$ has a domain of $\mathbb R$ in the last part.  That is only true if $f$ is also surjective.  It is true that every injective function has a left-inverse, but you have to define such a function for the entire domain with a little more care.  Not that it's a difficult task, but it's part of the proof.
