You can use your eurail pass also within a country. With an flexi-pass you have to use a travel day for that.
On a travel day, you can use any train of the participating railways and as many trains as you like. It doesn’t matter whether you're making an international journey or not.
DO note the ´participating´-in various countries there are now al kinds of ´private´=non-state owned railway ´companies´ that do not accept these passes. For CH=Swiss there is a long list as there are dozens of such companies-find it on the site under country-information. The main operators there: SBB, BLS, RHätische Bahn do accept it and also various others, but not all minor sidelines.
PS-IF you mainly intend to travel only in 1 country, then there is a cheaper ´1 country pass’and some of these touristy countries also have their own tourist passes, as indeed CH does. These may give you much more travel rights-f.e. the Swiss Holiday Pass also includes all POstal buses, citytransit and entry to most museums. Depending on your plans these may give better value!