I read in a book that R1 = U/I, why is that ? I mean why does R1 have the same voltage as the source and has the same current I? It was in an exercise to calculate the values of R1 and R2 .
If the exercise was along the lines of …
"Using only an ammeter, measure the values of R1 and R2".
… then the diagram you've posted could be the first half of the solution.
An ammeter placed across R2 as shown would (as other commenters have suggested) make R2 effectively zero resistance, and R1's value would indeed be U/I.
Step 2 would be to move the ammeter across R1 (effectively removing it from the equation) so R2's value would be U/I' (where I' is the new current reading).
However, it's a bit odd that the correct symbol for an ammeter wasn't used.
Do you remember the title/author of the book by any chance?