Consider the function case_when() from {dplyr}. It behaves sort of like the SQL equivalent, if you are familiar with that. The same applies for between(), also from {dplyr}.
library(dplyr)
y <- case_when(between(x, 0, 1/2) ~ 8*x/3,
between(x, 1/2, 1) ~ 4/3,
TRUE ~ 0)