CITY TRANSPORT:
Castellon is a pretty small city. The best solution is rent a flat in the center ( near Park Ribalta). From there you can go everywhere by walk. To University is approximately 30 minutes, to the beach is ~1hour. If you don't like to walk you can :
1.Rent a city bike
Price ~ 40euro /per year
2.Buy a bike
Price ~25/50 euro from second hand
3.Take a tram or bus
On ride is 1.05 euro and the monthly ticket is 30 euro
More information available here: public transport castellon
TRANSPORT TO OTHER CITIES:
1. Bus:
The most popular company in Spain is alsa Page of Alsa in english
2. Trains:
You can find theme here Spanish trains
3. Blablacar http://www.blablacar.es/
In Spain popular is using blablacar because is cheaper but if you want to use that option is better if you speak Spanish
4. Hitch-hiking
Is really difficult to hitch-hike in Spain. For example to catch a car to Valencia from Castellon can take even 5 hours because this way of travelling is not popular in Spain but this mihgt help you http://hitchwiki.org/maps/