I always thought linear functions need to satisfy $$f(x+y)=f(x)+f(y).$$ I am a tad confused now, consider $f(x)=2x+3$. $f(1)=5$, $f(2)=7$, $f(1+2)=f(3)=9 \neq f(1)+f(2)$ which was what I thought linear functions should satisfy.
Could someone clarify?
You're confusing between two different notions.
In calculus, a linear function is a polynomial function of the form $f(x)=ax+b$.
In linear algebra and functional analysis, a linear function is a linear map. (one of the properties that it satisfies is $f(x+y)=f(x)+f(y)$, known as additivity)
The difference between the two is that the latter needs to have $f(0)=0$. Proof: $$f(0)=f(0+0)=f(0)+f(0)=2f(0)\iff f(0)=0.$$ I discuss this in more detail in my (not yet finished) note.