Is it a scientific misconduct to change a variable or a function name when citing a math paper? The standard name of a function is S, but the author called it E. I want to cite his work, while I use the standard S.
It's certainly not a misconduct. Different authors use different notations. I've even seen different notations being used in papers from the same author. If the new name helps the reader understand what the function is supposed to do, or if it's a newer standard notation, then you are perfectly allowed to change it. In fact, I would encourage you to do so.
I would simply cite the work, write the formula and add a footnote on the lines of
¹ For consistency with the rest of the manuscript we renamed the function E in  as S.
¹ Note that in  the function S is denoted as E.
Some things have different letters due to their names for the item in different countries, one example is V for volts in English which in France is T for tension - which also can cause confusion as tension is something else in English.
So just cite the work and mention that the author uses E while you use S - a small comment in brackets is usually sufficient, you won’t need a page.
So it is not “scientific misconduct” but it does happen and most people (engineers etc) who work in more than one language tend to be aware and check if needed. They also tend to agree a common standard, but they can forget sometimes.
A roughly analogous question here is, "Is it scientific misconduct to give a quote using a different font than in the original?" Because that is really all you are doing when you use a different mathematical variable to show the same quantity --- you are using a symbol that looks different to the original but represents the same thing. This is quite common in mathematical papers. Often the writer will note that the original paper uses a different symbol, mostly so that the reader is not confused if they compare equations across papers. The only time this would be a problem is if you change the notation to non-standard notation that makes it hard to follow your work. Regardless, this practice is not even close to scientific misconduct.
some of the commenters (like avid and Sascha) have pointed out something I'd like to preserve in an answer (because comments may be deleted at any time): sometimes you HAVE to rename variables or functions you cited from other papers, because one of these papers might use a symbol that another paper uses for something else, or maybe you use the symbol yourself. In these cases, it is necessary to rename this symbol to resolve ambiguity.
For my personal perspective as a non-academic: In my opinion, avoiding ambiguity in science is more important than preserving the literal content of citations. In cases where preserving the literal content of a citation may introduce ambiguities with the rest of your paper, it is better to resolve the potential ambiguity and clarify the change from the original source. There are already other situations where changing cited content is not considered academic misconduct, like correcting poor translations with a footnote to indicate what has been changed, indicating typos with [sic] and editing out irrelevant partial sentences using [...].
You should use what is traditional. The point of any paper—although I did not understand this as a young academic—is to enlighten the reader about your results, not show fealty to one or another predecessor.
You can point out the change of notation in brackets if necessary for readers to understand if they compare the papers. It will probably be obvious. I added a footnote to my first paper, pointing out the discrepancy in notation between the fundamental paper in the field and the later paper I was then citing, but also that the authors of the second paper had themselves gotten confused and made a notation error interpreting the first paper, fortunately irrelevant to their results.
Needless to say, this footnote represented several hours of bewilderment on my part, especially since neither of the papers I was reading were in English.
The letter used to denote a function is, at least in principle, irrelevant. It's fine to rename it however you want. In fact, such renaming is often necessary to maintain consistent notation throughout the paper: It's OK to call a function F if a reference is calling it G; it's not OK to call a function F in one section and G in another section.
As an aside - during my BSc and MSc, it was a running joke to occasionally use the most obscure symbols for variables, including a variable denoted by a picture of a boot. It was widely acknowledged as valid (also by the faculty), although in academic practice it's probably preferable to stick with Latin and Greek letters :)
It's hard to imagine a situation where the author ("A") might have a problem with you using a more common notation, but I can think of a possibility where they might - if they were using a less common notation on purpose, to make some point.
Suppose, for example, there's some silly dispute over who published what first (which happens sometimes in math), and A calls it 'E' to assert that some "Prof. Evanoff" did it first. In this case A might be miffed if you just denote it 'S' while citing them, and might even complain that you mis-quoted them. Just mentioning in parentheses the fact that A denoted it 'E' in the paper that you cited, as other have suggested, should prevent this scenario from arising.
Only if you claim that what you write is actually a quote would that be wrong.
If you have a good reason to use a different notation it may possibly aid the readers understanding to mention the difference. Such a reason may be found in the fact that the context in which you write differs from that of the paper you cite. For example, in an electrical engineering journal you may way to use j rather than i for the square root of minus 1, that being conventional in electrical engineering and similarly a mathematician might use f to refer to a frequency where an electrical engineer would use a lower-case omega. Or possibly the paper you cite goes into complications that have no place in your writing, that necessitate a more complicated notation that is not justified in your context.