If you use fixed = TRUE you can create a single backslash by using four backslashes as your replacement argument. It will look like you haven't changed anything by default using print() (which is what's used when you send the object name to the console), but that's because R is printing the escape characters. You can see that the output is actually different using cat().
string <- "This is a string with double backslashes \\"
new_string <- gsub("\\\\", '\\\\', string, fixed = TRUE)
new_string
#> [1] "This is a string with double backslashes \\"
cat(new_string)
#> This is a string with double backslashes \
Indeed, I did what you suggest but my problem is that I need to create a string where inside the text I will include only only one backslash, I do not have to use cat().
the output I would like for exaple is " Hello my name is " but not using cat(), just print()
Sorry, no idea how with plain print() (though that's not to say it's impossible—someone else might know how).
The other alternative is to use writeLines(), which uses the same mechanism as cat() (i.e. doesn't print escape characters). You can see, for example, this is used in the Escaping section of the Regular Expressions vignette for stringr, since it's how you show the output unescaped.
library(stringr)
string <- "This is a string with double backslashes \\"
string
#> [1] "This is a string with double backslashes \\"
writeLines(str_replace(string, "\\\\", "\\\\"))
#> This is a string with double backslashes \